...
Run Format

Text file src/cmd/go/testdata/script/vet_cache.txt

Documentation: cmd/go/testdata/script

     1# Test that go vet's caching of vet tool actions replays
     2# the recorded stderr output even after a cache hit.
     3
     4[short] skip 'uses a fresh build cache'
     5
     6# Set up fresh GOCACHE.
     7env GOCACHE=$WORK/gocache
     8
     9# First time is a cache miss.
    10! go vet example.com/a
    11stderr 'fmt.Sprint call has possible Printf formatting directive'
    12
    13# Second time is assumed to be a cache hit for the stdout JSON,
    14# but we don't bother to assert it. Same diagnostics again.
    15! go vet example.com/a
    16stderr 'fmt.Sprint call has possible Printf formatting directive'
    17
    18-- go.mod --
    19module example.com
    20
    21-- a/a.go --
    22package a
    23
    24import "fmt"
    25
    26var _ = fmt.Sprint("%s") // oops!

View as plain text