From 5262546d8296a6bed3fcd385385db51bd3e5f48b Mon Sep 17 00:00:00 2001 From: Sean Liao Date: Fri, 13 Mar 2026 21:05:17 +0000 Subject: [PATCH] cmd/go/internal/test: enable stdversion by default Also, update the list of available checks, including using the non-deprecated names. Updates #18085 Fixes #77729 Change-Id: Ic31a53fda5628f0de85c7f447182f0d4b1cdcdb2 Reviewed-on: https://go-review.googlesource.com/c/go/+/755240 Reviewed-by: Michael Matloob LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Matloob Reviewed-by: Alan Donovan --- src/cmd/go/alldocs.go | 10 +++++----- src/cmd/go/internal/test/test.go | 30 ++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 402cbc0ed5..8231261182 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1875,11 +1875,11 @@ // and its test source files to identify significant problems. If go vet // finds any problems, go test reports those and does not run the test // binary. Only a high-confidence subset of the default go vet checks are -// used. That subset is: atomic, bool, buildtags, directive, errorsas, -// ifaceassert, nilfunc, printf, stringintconv, and tests. You can see -// the documentation for these and other vet tests via "go doc cmd/vet". -// To disable the running of go vet, use the -vet=off flag. To run all -// checks, use the -vet=all flag. +// used. That subset is: atomic, bools, buildtag, directive, errorsas, +// ifaceassert, nilfunc, printf, stdversion, stringintconv, and tests. +// You can see the documentation for these and other vet tests via +// "go doc cmd/vet". To disable the running of go vet, use the -vet=off flag. +// To run all checks, use the -vet=all flag. // // All test output and summary lines are printed to the go command's // standard output, even if the test printed them to its own standard diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index 9309aa65ed..5c3093a58d 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -78,11 +78,11 @@ As part of building a test binary, go test runs go vet on the package and its test source files to identify significant problems. If go vet finds any problems, go test reports those and does not run the test binary. Only a high-confidence subset of the default go vet checks are -used. That subset is: atomic, bool, buildtags, directive, errorsas, -ifaceassert, nilfunc, printf, stringintconv, and tests. You can see -the documentation for these and other vet tests via "go doc cmd/vet". -To disable the running of go vet, use the -vet=off flag. To run all -checks, use the -vet=all flag. +used. That subset is: atomic, bools, buildtag, directive, errorsas, +ifaceassert, nilfunc, printf, stdversion, stringintconv, and tests. +You can see the documentation for these and other vet tests via +"go doc cmd/vet". To disable the running of go vet, use the -vet=off flag. +To run all checks, use the -vet=all flag. All test output and summary lines are printed to the go command's standard output, even if the test printed them to its own standard @@ -654,31 +654,41 @@ func testShowPass() bool { var defaultVetFlags = []string{ // TODO(rsc): Decide which tests are enabled by default. // See golang.org/issue/18085. + // "-appends", // "-asmdecl", // "-assign", "-atomic", - "-bool", - "-buildtags", + "-bools", + "-buildtag", // "-cgocall", // "-composites", // "-copylocks", + // "-defers", "-directive", "-errorsas", + // "-framepointer", + // "-hostport", // "-httpresponse", "-ifaceassert", + // "-loopclosure", // "-lostcancel", - // "-methods", "-nilfunc", "-printf", - // "-rangeloops", // "-shift", + // "-sigchanyzer", "-slog", + // "-stdmethods", + "-stdversion", "-stringintconv", - // "-structtags", + // "-structtag", + // "-testinggoroutine", "-tests", + // "-timeformat", + // "-unmarshal", // "-unreachable", // "-unsafeptr", // "-unusedresult", + // "-waitgroup", } func runTest(ctx context.Context, cmd *base.Command, args []string) {