x/tools/go/analysis/passes/nilness: false negative with pointers and type assertions #47938
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Currently, as of
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff
andgo1.17
,nilness
doesn't mark the following code as invalid despitett
being provably nil:If
ok
is false thentt
is nil, since that is the default value for pointers.Playground: https://play.golang.org/p/0ni1nXpLBFK.
The text was updated successfully, but these errors were encountered: