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