diff options
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/vet_flags.txt')
-rw-r--r-- | libgo/go/cmd/go/testdata/script/vet_flags.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/vet_flags.txt b/libgo/go/cmd/go/testdata/script/vet_flags.txt new file mode 100644 index 00000000000..94bfd126c09 --- /dev/null +++ b/libgo/go/cmd/go/testdata/script/vet_flags.txt @@ -0,0 +1,37 @@ +env GO111MODULE=on + +# gccgo doesn't support vet on the standard library +[gccgo] skip + +# Regression test for issue 35837: "go vet -<analyzer> <std package>" +# did not apply the requested analyzer. +go vet -n -unreachable=false encoding/binary +stderr '-unreachable=false' +! stderr '-unsafeptr=false' + +[short] stop +env GOCACHE=$WORK/gocache +env GOTMPDIR=$WORK/tmp +go env GOTMPDIR +stdout '/tmp' + +# "go test" on a user package should by default enable an explicit whitelist of analyzers. +go test -x -run=none . +stderr '[/\\]vet'$GOEXE'["]? .* -errorsas .* ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg' + +# "go test" on a standard package should by default disable an explicit blacklist. +go test -x -run=none encoding/binary +stderr '[/\\]vet'$GOEXE'["]? -unsafeptr=false ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg' + +# Both should allow users to override via the -vet flag. +go test -x -vet=unreachable -run=none . +stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg' +go test -x -vet=unreachable -run=none encoding/binary +stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg' + +-- go.mod -- +module example.com/x +-- x.go -- +package x +-- x_test.go -- +package x |