aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/test/testflag.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-05-09 18:55:02 -0400
committerRuss Cox <rsc@golang.org>2019-05-16 03:24:56 +0000
commit4f76871bd75530682964bd81d050e280c5309438 (patch)
tree4c4db07a7bbe1b21b4b7d5fa7cb3c39528266583 /src/cmd/go/internal/test/testflag.go
parent639ac76d453073da49a6a1d89b957cfa1bfef1af (diff)
downloadgo-4f76871bd75530682964bd81d050e280c5309438.tar.gz
go-4f76871bd75530682964bd81d050e280c5309438.zip
cmd/go: run full 'go vet' during 'go test' for packages in GOROOT
Now that the main tree complies with 'go vet', enable all vet checks during 'go test' in the main tree. This helps surface helpful errors while developing, instead of having to wait for the misc-vet-vetall builder. During 'go test', the additional vet checks are essentially free: the vet invocations themselves take only 8 seconds total for the entire tree. Also update buildall.bash (used by the misc-compile builders) to run 'go vet std cmd' for each GOOS/GOARCH pair. This is not as free, since in general it can require recompiling packages with their tests included before invoking vet. (That compilation was going on anyway in the 'go test' case.) On my Mac laptop, ./buildall.bash freebsd used to take 68+16+17+18 = 119 seconds for make.bash and then the builds of the three freebsd architectures. Now it takes 68+16+23+17+23+18+24 = 189 seconds, 60% longer. Some of this is spent doing unnecessary cgo work. Still, this lets us shard the vet checks and match all.bash. Fixes #20119. For #31916. Change-Id: I6b0c40bac47708a688463c7fca12c0fc23ab2751 Reviewed-on: https://go-review.googlesource.com/c/go/+/176439 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/go/internal/test/testflag.go')
-rw-r--r--src/cmd/go/internal/test/testflag.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/go/internal/test/testflag.go b/src/cmd/go/internal/test/testflag.go
index ebcf49a4e9..138e1f9d2a 100644
--- a/src/cmd/go/internal/test/testflag.go
+++ b/src/cmd/go/internal/test/testflag.go
@@ -202,6 +202,7 @@ func testFlags(usage func(), args []string) (packageNames, passToTest []string)
}
}
+ testVetExplicit = testVetList != ""
if testVetList != "" && testVetList != "off" {
if strings.Contains(testVetList, "=") {
base.Fatalf("-vet argument cannot contain equal signs")