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