]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: limit printf check to known Printf-like functions
authorRuss Cox <rsc@golang.org>
Wed, 13 Dec 2017 19:45:50 +0000 (14:45 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 14 Dec 2017 19:56:46 +0000 (19:56 +0000)
commit558eeb2d850d064b0b02b65a7bf3af6c108c248d
tree955c8c370f8411eb24cbfb4a6aa1ef8270e0153a
parent9006d1f85f51c41f84be5ef11f5b36479778e4b4
cmd/vet: limit printf check to known Printf-like functions

The name-based heuristics fail too often to be on during "go test",
but we really want the printf vet check in "go test", so change to
a list of exactly which standard library functions are print-like.

For a later release we'd like to bring back checking for user-defined
wrappers, but in a completely precise way. Not for Go 1.10, though.

The new, more precise list includes t.Skipf, which caught some
mistakes in standard library tests.

Fixes #22936.

Change-Id: I110448e3f6b75afd4327cf87b6abb4cc2021fd0d
Reviewed-on: https://go-review.googlesource.com/83838
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/vet/main.go
src/cmd/vet/print.go
src/cmd/vet/testdata/print.go
src/cmd/vet/vet_test.go