Skip to content

false positive nilerr warning on unrelated error return? #12

@dkegel-fastly

Description

@dkegel-fastly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions