Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.golangci.yml: disable staticcheck nil pointer deref check
Currently it produces false reports with Go1.16: tools/syz-runtest/runtest.go:271:6: SA5011: possible nil pointer dereference req.Output = a.Output ^ tools/syz-runtest/runtest.go:272:6: SA5011: possible nil pointer dereference req.Info = a.Info ^ sys/fuchsia/fidlgen/main.go:27:17: SA5011: possible nil pointer dereference arch := target.KernelHeaderArch ^ All these are preceeded with log.Fatalf, which is strange... Update #2446
- Loading branch information
c8f51f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works fine with the
staticcheck
command, so I'm blaming golangci-lint.c8f51f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking. I guess we need to file a golangci-lint issue. How can I run staticcheck command itself on a package? Or, if you already reproduced it, do you mind filing an issue?
c8f51f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wonder how did you find this commit? :)
c8f51f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get no SA5011 report with the existing code, and do get it if I comment out the first call to
tool.Failf
, which suggests to me that it is working.I actually can't reproduce the problem. Running golangci-lint 1.36.0 against
./sys/fuchsia/fidlgen
produces no errors, unless I comment out the call totool.Failf
.Every once in a while I search GitHub for commits and issues mentioning Staticcheck, to find issues like these.
c8f51f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR filed golangci/golangci-lint#1768