cmd/vet: printf %q with pointer argument not detected #25233
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go version go1.10.1 linux/amd64
Does this issue reproduce with the latest release?
Yes. Also in Git master as of 2018-05-03.
What did you do?
The programs prints
%!q(*string=0xc42000e1e0)
butgo vet
prints no error message.What did you expect to see?
go vet
detects the error.The problem seems to be the type classification which marks
%q
asargRune|argInt|argString
, this causes the check incmd/vet/types.go
matchArgTypeInternal()
(undercase *types.Pointer
) to considery
(from code above) as valid int, although this won't work with pointers for%q
.A potential patch could look like this. However it feels ugly and therefor wasn't submitted as pull request:
The text was updated successfully, but these errors were encountered: