Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false positive nilerr warning on unrelated error return? #12

Open
dkegel-fastly opened this issue Apr 22, 2022 · 0 comments
Open

false positive nilerr warning on unrelated error return? #12

dkegel-fastly opened this issue Apr 22, 2022 · 0 comments

Comments

@dkegel-fastly
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant