nilerr
nilerr copied to clipboard
false positive nilerr warning on unrelated error return?
Reproduced with golangci-lint version 1.45.2 built from 8bdc4d3 on 2022-03-24T11:49:36Z
Running lint shows this warning:
error is not nil (line 51) but it returns nil (nilerr)
on a closed-source function like this:
func foo() (err error) {
...
query, qerr = url.QueryUnescape(query)
if qerr != nil {
return nil
}
...
}
nilerr seems to be convinced that qerr being non-nil means the whole function should return a non-nil error.
I have been unable to extract a minimal case for some reason. Happy to try new versions.