]> Cypherpunks repositories - gostls13.git/commit
cmd/vet/all: use x/tools/go/analysis/cmd/vet not cmd/vet
authorAlan Donovan <adonovan@google.com>
Mon, 12 Nov 2018 20:48:46 +0000 (15:48 -0500)
committerAlan Donovan <adonovan@google.com>
Thu, 15 Nov 2018 18:46:33 +0000 (18:46 +0000)
commitb2df0bd5f53e599fef9fcb808304dd0e5ea3ba0b
tree3fa891afd510467e452c5bf3a805907de01929c6
parenta18638c0f2ce487e08bbe67674a95faef5b43651
cmd/vet/all: use x/tools/go/analysis/cmd/vet not cmd/vet

cmd/vet/all applies vet to all packages in the standard tree.
It is run for every configuration using this command:
  GO_BUILDER_NAME=misc-vetall go tool dist test
by the misc-vetall builder (see chart at build.golang.org).

Ideally we would switch to 'go vet', but it effectively does a partial
build. This means that its analysis has accurate type information, so
it reports slightly fewer spurious diagnostics. However, it is more
than twice as slow.

Instead, cmd/vet/all builds and runs
golang.org/x/tools/go/analysis/cmd/vet, which uses x/tools/go/packages
to load the entire std lib from source. It takes about 4min to run all
OS/ARCH pairs. An important consequence is that golang.org/x/tools
must be on your $GOPATH to run cmd/vet/all. The test has been
temporarily modified to warn and skip if this is not the case.

This is a preparatory step for switching to the new
cmd/vet based on vet-lite.

Whitelist changes:
- The two "deadcode" diagnostics removed from the whitelist were due
  to if-conditions that could now be proven false.
- The asmdecl warnings are now printed with the log.Printf prefix,
  so they are discarded by the parser and needn't be whitelisted.

Change-Id: I6486508b0de2cd947c897523af086a408cbaf4a8
Reviewed-on: https://go-review.googlesource.com/c/149097
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
15 files changed:
src/cmd/vet/all/main.go
src/cmd/vet/all/whitelist/386.txt
src/cmd/vet/all/whitelist/all.txt
src/cmd/vet/all/whitelist/amd64.txt
src/cmd/vet/all/whitelist/arm.txt
src/cmd/vet/all/whitelist/arm64.txt
src/cmd/vet/all/whitelist/mipsx.txt
src/cmd/vet/all/whitelist/nacl_386.txt
src/cmd/vet/all/whitelist/nacl_amd64p32.txt
src/cmd/vet/all/whitelist/nacl_arm.txt
src/cmd/vet/all/whitelist/ppc64x.txt
src/cmd/vet/all/whitelist/s390x.txt
src/cmd/vet/all/whitelist/wasm.txt
src/cmd/vet/all/whitelist/windows_386.txt
src/cmd/vet/all/whitelist/windows_amd64.txt