aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Knyszek <mknyszek@google.com>2024-03-14 16:06:41 +0000
committerGopher Robot <gobot@golang.org>2024-03-14 16:58:10 +0000
commit1304d9843e446f2a16a513a6faa071538c17f7b9 (patch)
treec816856e5c9c16dca7a63fff45c2d2d5e053e856
parent64017d10e1386c037aab2b7599e3256cab2a9188 (diff)
downloadgo-1304d9843e446f2a16a513a6faa071538c17f7b9.tar.gz
go-1304d9843e446f2a16a513a6faa071538c17f7b9.zip
Revert "cmd/go/internal/test: add 'tests' vet check to 'go test' suite"
This reverts commit f1d60500bcc48f06c8d322dac1e48dd4c22f5863. Reason for revert: Broke the longtest builders. Change-Id: I5f3510c8ffc24fae5e71fac0a2dbda01ecfe5d5c Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/571695 Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Russ Cox <rsc@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
-rw-r--r--doc/next/3-tools.md9
-rw-r--r--src/cmd/go/alldocs.go2
-rw-r--r--src/cmd/go/internal/test/test.go4
-rw-r--r--src/cmd/go/testdata/script/test_bad_example.txt5
4 files changed, 5 insertions, 15 deletions
diff --git a/doc/next/3-tools.md b/doc/next/3-tools.md
index 56d82e4926e..bdbe6c07717 100644
--- a/doc/next/3-tools.md
+++ b/doc/next/3-tools.md
@@ -10,12 +10,3 @@ or copying the `go` binary.
### Cgo {#cgo}
-### Vet
-
-The new `tests` analyzer reports common mistakes in declarations of
-tests, fuzzers, benchmarks, and examples in test packages, such as
-malformed names, wrong signatures, or examples that document
-non-existent identifiers. Some of these mistakes may cause tests not
-to run.
-
-This analyzer is among the subset of analyzers that are run by `go test`.
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index cf3485faac2..dde47ac1b86 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1756,7 +1756,7 @@
// 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
+// ifaceassert, nilfunc, printf, and stringintconv. 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.
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go
index 17dc3a0fdbe..f1555fd5d42 100644
--- a/src/cmd/go/internal/test/test.go
+++ b/src/cmd/go/internal/test/test.go
@@ -79,7 +79,7 @@ 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
+ifaceassert, nilfunc, printf, and stringintconv. 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.
@@ -667,7 +667,7 @@ var defaultVetFlags = []string{
"-slog",
"-stringintconv",
// "-structtags",
- "-tests",
+ // "-tests",
// "-unreachable",
// "-unsafeptr",
// "-unusedresult",
diff --git a/src/cmd/go/testdata/script/test_bad_example.txt b/src/cmd/go/testdata/script/test_bad_example.txt
index 46bc264779e..1d147b663fe 100644
--- a/src/cmd/go/testdata/script/test_bad_example.txt
+++ b/src/cmd/go/testdata/script/test_bad_example.txt
@@ -1,7 +1,6 @@
# Tests that invalid examples are ignored.
# Verifies golang.org/issue/35284
-# Disable vet, as 'tests' analyzer objects to surplus parameter.
-go test -vet=off x_test.go
+go test x_test.go
-- x_test.go --
package x
@@ -11,4 +10,4 @@ import "fmt"
func ExampleThisShouldNotHaveAParameter(thisShouldntExist int) {
fmt.Println("X")
// Output:
-}
+} \ No newline at end of file