...
1# Test that errors importing packages are reported on the importing package,
2# not the imported package.
3
4env GO111MODULE=off # simplify vendor layout for test
5
6go list -e -deps -f '{{.ImportPath}}: {{.Error}}' ./importvendor
7stdout 'importvendor: importvendor[\\/]p.go:2:8: vendor/p must be imported as p'
8stdout 'vendor/p: <nil>'
9
10go list -e -deps -f '{{.ImportPath}}: {{.Error}}' ./importinternal
11stdout 'importinternal: package importinternal\n\timportinternal[\\/]p.go:2:8: use of internal package other/internal/p not allowed'
12stdout 'other/internal/p: <nil>'
13-- importvendor/p.go --
14package importvendor
15import "vendor/p"
16-- importinternal/p.go --
17package importinternal
18import "other/internal/p"
19-- other/internal/p/p.go --
20package p
21-- vendor/p/p.go --
22package p
View as plain text