1
0
mirror of https://github.com/golang/go synced 2024-11-22 19:54:39 -07:00

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>
This commit is contained in:
Bryan C. Mills 2023-02-08 14:36:47 -05:00 committed by Gopher Robot
parent 0d8d181bd5
commit 910f041ff0
3 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -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) {

View File

@ -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)