]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: fix printf false negative with nested pointers
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 6 Nov 2018 21:35:23 +0000 (21:35 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 9 Nov 2018 14:58:47 +0000 (14:58 +0000)
commit4d913b332cf161df7c4f3717c602d491d7ac01dd
tree4e1a692bb45e87597c48f3903f4cb6988572edde
parentedb2d1cbf23c1a638837f21bc7dd51a0807ab236
cmd/vet: fix printf false negative with nested pointers

Pointers to compound objects (structs, slices, arrays, maps) are only
followed by fmt if the pointer is at the top level of an argument. This
is to minimise the chances of fmt running into loops.

However, vet did not follow this rule. It likely doesn't help that fmt
does not document that restriction well, which is being tracked in
 #28625.

Updates #27672.

Change-Id: Ie9bbd9b974eda5ab9a285986d207ef92fca4453e
Reviewed-on: https://go-review.googlesource.com/c/147997
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/vet/testdata/print.go
src/cmd/vet/types.go