]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: don't run buildtag check when in vetxonly mode
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 28 Jun 2018 16:18:01 +0000 (17:18 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 29 Jun 2018 08:33:11 +0000 (08:33 +0000)
commit1d1e25fba88b5c61cd25889d005875848a993ea3
tree9b4498295bda708df58ea4d1cb5e76837f679fc3
parent997d7a1893ae15df1438c46487dd69903f16c57f
cmd/vet: don't run buildtag check when in vetxonly mode

The check was running in the loop that read source files in, much before
any of the other checks ran. Vetxonly makes vet exit early, but after
all the source files have been read.

To fix this, simply run the buildtag check along with all the other
checks that get run on specific syntax tree nodes.

Add a cmd/go test with go test -a, to ensure that the issue as reported
is fixed.

Fixes #26102.

Change-Id: If6e3b9418ffa8166c0f982668b0d10872283776a
Reviewed-on: https://go-review.googlesource.com/121395
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/go_test.go
src/cmd/go/testdata/src/vetfail/p1/p1.go
src/cmd/vet/main.go