It would be great if the tool could also check cases where errors are wrapped using defer, such as with golang.org/x/pkgsite/internal/derrors.Wrap.
func wrap(errp *error) {}
func f() (err error) {
defer wrap(&err)
err = do()
if err != nil {
return nil // want "error is not nil"
}
return nil
}
Would it be possible to add support for this scenario?