Skip to content

Commit 6af9635

Browse files
committed
cmd/go: enable vet directive analyzer during 'go test'
For #56986, run the new directive analyzer during 'go test', to diagnose problems that would otherwise be missed, like //go:debug appearing in the wrong place in a file or in the wrong files. Change-Id: I1ac230c3c67e58b5e584128e0ec6ff482cb225f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/464135 Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent d54aeee commit 6af9635

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/cmd/go/alldocs.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/test/test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ As part of building a test binary, go test runs go vet on the package
7676
and its test source files to identify significant problems. If go vet
7777
finds any problems, go test reports those and does not run the test
7878
binary. Only a high-confidence subset of the default go vet checks are
79-
used. That subset is: 'atomic', 'bool', 'buildtags', 'errorsas',
80-
'ifaceassert', 'nilfunc', 'printf', and 'stringintconv'. You can see
79+
used. That subset is: atomic, bool, buildtags, directive, errorsas,
80+
ifaceassert, nilfunc, printf, and stringintconv. You can see
8181
the documentation for these and other vet tests via "go doc cmd/vet".
8282
To disable the running of go vet, use the -vet=off flag. To run all
8383
checks, use the -vet=all flag.
@@ -642,6 +642,7 @@ var defaultVetFlags = []string{
642642
// "-cgocall",
643643
// "-composites",
644644
// "-copylocks",
645+
"-directive",
645646
"-errorsas",
646647
// "-httpresponse",
647648
"-ifaceassert",

0 commit comments

Comments
 (0)