github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/vet_flags.txt (about)

     1  env GO111MODULE=on
     2  
     3  # Regression test for issue 35837: "go vet -<analyzer> <std package>"
     4  # did not apply the requested analyzer.
     5  go vet -n -unreachable=false encoding/binary
     6  stderr '-unreachable=false'
     7  ! stderr '-unsafeptr=false'
     8  
     9  # Issue 37030: "go vet <std package>" without other flags should disable the
    10  # unsafeptr check by default.
    11  go vet -n encoding/binary
    12  stderr '-unsafeptr=false'
    13  ! stderr '-unreachable=false'
    14  
    15  # However, it should be enabled if requested explicitly.
    16  go vet -n -unsafeptr encoding/binary
    17  stderr '-unsafeptr'
    18  ! stderr '-unsafeptr=false'
    19  
    20  [short] stop
    21  env GOCACHE=$WORK/gocache
    22  env GOTMPDIR=$WORK/tmp
    23  go env GOTMPDIR
    24  stdout '/tmp'
    25  
    26  # "go test" on a user package should by default enable an explicit whitelist of analyzers.
    27  go test -x -run=none .
    28  stderr '[/\\]vet'$GOEXE'["]? .* -errorsas .* ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
    29  
    30  # "go test" on a standard package should by default disable an explicit blacklist.
    31  go test -x -run=none encoding/binary
    32  stderr '[/\\]vet'$GOEXE'["]? -unsafeptr=false ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
    33  
    34  # Both should allow users to override via the -vet flag.
    35  go test -x -vet=unreachable -run=none .
    36  stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
    37  go test -x -vet=unreachable -run=none encoding/binary
    38  stderr '[/\\]vet'$GOEXE'["]? -unreachable ["]?\$WORK[/\\][^ ]*[/\\]vet\.cfg'
    39  
    40  -- go.mod --
    41  module example.com/x
    42  -- x.go --
    43  package x
    44  -- x_test.go --
    45  package x