Open
Description
I would like staticcheck to detect the following:
func foo() error {
...
err := bar()
if err != nil {
return nil // BUG! Most of the time it should be `return err`
}
...
}
Sometimes, of course, you want to explicitly return an error there, so this check will have quite a few false positives.
Most of the time, however, it will detect bugs.