1 # Package with external tests
2 ! go vet m/vetpkg
3 stderr 'Printf'
4
5 # With tags
6 ! go vet -tags tagtest m/vetpkg
7 stderr 'c\.go.*Printf'
8
9 # With flags on
10 ! go vet -printf m/vetpkg
11 stderr 'Printf'
12
13 # With flags off
14 go vet -printf=false m/vetpkg
15 ! stderr .
16
17 # With only test files (tests issue #23395)
18 go vet m/onlytest
19 ! stderr .
20
21 # With only cgo files (tests issue #24193)
22 [!cgo] skip
23 [short] skip
24 go vet m/onlycgo
25 ! stderr .
26
27 -- go.mod --
28 module m
29
30 go 1.16
31 -- vetpkg/a_test.go --
32 package p_test
33 -- vetpkg/b.go --
34 package p
35
36 import "fmt"
37
38 func f() {
39 fmt.Printf("%d")
40 }
41 -- vetpkg/c.go --
42 // +build tagtest
43
44 package p
45
46 import "fmt"
47
48 func g() {
49 fmt.Printf("%d", 3, 4)
50 }
51 -- onlytest/p_test.go --
52 package p
53
54 import "testing"
55
56 func TestMe(*testing.T) {}
57 -- onlycgo/p.go --
58 package p
59
60 import "C"
61
62 func F() {}
63
View as plain text