1 env GO111MODULE=off
2
3 # Issue 36173. Verify that "go vet" prints line numbers on load errors.
4
5 ! go vet a/a.go
6 stderr '^package command-line-arguments\n\ta[/\\]a.go:5:3: use of internal package'
7
8 ! go vet a/a_test.go
9 stderr '^package command-line-arguments \(test\)\n\ta[/\\]a_test.go:4:3: use of internal package'
10
11 ! go vet a
12 stderr '^package a\n\ta[/\\]a.go:5:3: use of internal package'
13
14 go vet b/b.go
15 ! stderr 'use of internal package'
16
17 ! go vet b/b_test.go
18 stderr '^package command-line-arguments \(test\)\n\tb[/\\]b_test.go:4:3: use of internal package'
19
20 ! go vet depends-on-a/depends-on-a.go
21 stderr '^package command-line-arguments\n\timports a\n\ta[/\\]a.go:5:3: use of internal package'
22
23 ! go vet depends-on-a/depends-on-a_test.go
24 stderr '^package command-line-arguments \(test\)\n\timports a\n\ta[/\\]a.go:5:3: use of internal package a/x/internal/y not allowed'
25
26 ! go vet depends-on-a
27 stderr '^package depends-on-a\n\timports a\n\ta[/\\]a.go:5:3: use of internal package'
28
29 -- a/a.go --
30 // A package with bad imports in both src and test
31 package a
32
33 import (
34 _ "a/x/internal/y"
35 )
36
37 -- a/a_test.go --
38 package a
39
40 import (
41 _ "a/x/internal/y"
42 )
43
44 -- b/b.go --
45 // A package with a bad import in test only
46 package b
47
48 -- b/b_test.go --
49 package b
50
51 import (
52 _ "a/x/internal/y"
53 )
54
55 -- depends-on-a/depends-on-a.go --
56 // A package that depends on a package with a bad import
57 package depends
58
59 import (
60 _ "a"
61 )
62
63 -- depends-on-a/depends-on-a_test.go --
64 package depends
65
66 import (
67 _ "a"
68 )
69
70 -- a/x/internal/y/y.go --
71 package y
72
View as plain text