Closed as not planned
Closed as not planned
Description
Proposal Details
I ran into a piece of code today that did
if something {
fmt.Errorf("something happened: %s", someString)
}
if somethingElse {
return fmt.Errorf("something else happened: %s", someOtherString)
}
Clearly the first one was a mistake, the intention was to return. I think it would be nice if vet flagged such uses of Errorf, Wrapf, errors.New as they are most definitely not intentional.
There is an existing tool, https://github.com/kisielk/errcheck which would have pointed this out. However, in my experience integrating it in existing codebases can be quite tedious and requires fixing many calls that might be fishy but not necessarily buggy.