summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2023-02-08 14:36:47 -0500
committerGopher Robot <gobot@golang.org>2023-02-08 23:52:18 +0000
commit910f041ff0cdf90dbcd3bd22a272b9b7205a5add (patch)
tree5c237cb1806bd6b97cdcdd585e36ffc89b452d2e
parent0d8d181bd575dca359266a1008b436b50db8ba18 (diff)
downloadgo-git-910f041ff0cdf90dbcd3bd22a272b9b7205a5add.tar.gz
cmd/go/internal/test: refresh flagdefs.go and fix test
The tests for cmd/go/internal/test were not running at all due to a missed call to m.Run in TestMain. That masked two missing vet analyzers ("directive" and "timeformat") and a missed update to the generator script in CL 355452. Fixes #58415. Change-Id: I7b0315952967ca07a866cdaa5903478b2873eb7a Reviewed-on: https://go-review.googlesource.com/c/go/+/466635 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com>
-rw-r--r--src/cmd/go/internal/test/flagdefs.go2
-rw-r--r--src/cmd/go/internal/test/flagdefs_test.go2
-rw-r--r--src/cmd/go/internal/test/genflags.go2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/go/internal/test/flagdefs.go b/src/cmd/go/internal/test/flagdefs.go
index b91204ee93..d9f4fca17a 100644
--- a/src/cmd/go/internal/test/flagdefs.go
+++ b/src/cmd/go/internal/test/flagdefs.go
@@ -49,6 +49,7 @@ var passAnalyzersToVet = map[string]bool{
"cgocall": true,
"composites": true,
"copylocks": true,
+ "directive": true,
"errorsas": true,
"framepointer": true,
"httpresponse": true,
@@ -66,6 +67,7 @@ var passAnalyzersToVet = map[string]bool{
"structtag": true,
"testinggoroutine": true,
"tests": true,
+ "timeformat": true,
"unmarshal": true,
"unreachable": true,
"unsafeptr": true,
diff --git a/src/cmd/go/internal/test/flagdefs_test.go b/src/cmd/go/internal/test/flagdefs_test.go
index 337f136d06..1c46d78b1b 100644
--- a/src/cmd/go/internal/test/flagdefs_test.go
+++ b/src/cmd/go/internal/test/flagdefs_test.go
@@ -9,6 +9,7 @@ import (
"cmd/go/internal/test/internal/genflags"
"flag"
"internal/testenv"
+ "os"
"reflect"
"strings"
"testing"
@@ -16,6 +17,7 @@ import (
func TestMain(m *testing.M) {
cfg.SetGOROOT(testenv.GOROOT(nil), false)
+ os.Exit(m.Run())
}
func TestPassFlagToTestIncludesAllTestFlags(t *testing.T) {
diff --git a/src/cmd/go/internal/test/genflags.go b/src/cmd/go/internal/test/genflags.go
index 8c7554919a..625f94133a 100644
--- a/src/cmd/go/internal/test/genflags.go
+++ b/src/cmd/go/internal/test/genflags.go
@@ -75,7 +75,7 @@ func testFlags() []string {
}
switch name {
- case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker":
+ case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker", "gocoverdir":
// These flags are only for use by cmd/go.
default:
names = append(names, name)