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

     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.
     7  env GOCACHE=$WORK/gocache
     8  
     9  # First time is a cache miss.
    10  ! go vet example.com/a
    11  stderr '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
    16  stderr 'fmt.Sprint call has possible Printf formatting directive'
    17  
    18  -- go.mod --
    19  module example.com
    20  
    21  -- a/a.go --
    22  package a
    23  
    24  import "fmt"
    25  
    26  var _ = fmt.Sprint("%s") // oops!
    27  

View as plain text