uber-go / nilaway

Static analysis tool to detect potential nil panics in Go code
Apache License 2.0
3.19k stars 66 forks source link

false positive ignore #263

Closed madneal closed 4 months ago

madneal commented 4 months ago

If we are confirmed that there are some false positive lints for specific line. Is there any way to mark it as ignored for lint again?

yuxincs commented 4 months ago

You can add //nolint: nilaway to the specific line to indicate that the nilaway error on the particular line should be ignored.

Note that this ignore logic is implemented by the analyzer driver of your choice. Bazel/nogo and golangci-lint should have support for it, the standalone checker (which under the hood uses x/tools/go/analysis/singlechecker) currently does not. However, the standalone checker is really only for evaluation purposes such that it's not recommended to be used in production anyway.

I'm closing this issue, but feel free to re-open it if the above doesn't answer your question :)