1 env GO111MODULE=on
2 env GOPROXY=off
3
4 [!compiler:gc] skip
5 [short] skip
6
7 # Outside of GOROOT, our vendored packages should be reported as part of the standard library.
8 go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' std cmd
9 stdout ^vendor/golang\.org/x/net/http2/hpack
10 stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm
11 ! stdout ^golang\.org/x/
12
13 # The dependencies of those packages should also be vendored.
14 go list -deps vendor/golang.org/x/crypto/chacha20
15 stdout ^vendor/golang\.org/x/crypto/internal/alias
16
17 # cmd/... should match the same packages it used to match in GOPATH mode.
18 go list cmd/...
19 stdout ^cmd/compile
20 ! stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm
21
22 # GOROOT/src/... should list the packages in std as if it were a module
23 # dependency: omitting vendored dependencies and stopping at the 'cmd' module
24 # boundary.
25
26 go list $GOROOT/src/...
27 stdout ^bytes$
28 ! stdout ^builtin$
29 ! stdout ^cmd/
30 ! stdout ^vendor/
31 ! stdout ^golang\.org/x/
32
33
34 # Vendored dependencies should appear with their 'vendor/' paths in std (they're
35 # in GOROOT/src, but not in the 'std' module following the usual module-boundary
36 # rules).
37
38 cd $GOROOT/src
39 env GOWORK=off
40
41 go list std
42 stdout ^vendor/golang.org/x/net/http2/hpack
43 ! stdout ^golang\.org/x
44
45 # The dependencies of packages with an explicit 'vendor/' prefix should
46 # still themselves resolve to vendored packages.
47 go list -deps vendor/golang.org/x/crypto/chacha20
48 stdout ^vendor/golang.org/x/crypto/internal/alias
49 ! stdout ^golang\.org/x
50
51 # Within the std module, the dependencies of the non-vendored packages within
52 # std should appear to be packages beginning with 'vendor/', not 'golang.org/…'
53 # module dependencies.
54
55 go list all
56 ! stdout ^golang.org/x/
57 ! stdout ^std/
58 ! stdout ^cmd/
59 stdout ^vendor/
60
61 go list -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' std
62 ! stdout .
63
64 # However, the 'golang.org/…' module dependencies should resolve to those same
65 # directories.
66
67 go list -f '{{.Dir}}' golang.org/x/net/http2/hpack
68 stdout $GOROOT[/\\]src[/\\]vendor
69
70 # Within the std module, the packages within the module should omit the 'std/'
71 # prefix (they retain their own identities), but should respect normal module
72 # boundaries (vendored packages are not included in the module, even though they
73 # are included in the 'std' pattern).
74
75 go list ./...
76 stdout ^bytes$
77 ! stdout ^builtin$
78 ! stdout ^cmd/
79 ! stdout ^vendor/
80 ! stdout ^golang\.org/x/
81
82
83 # Within std, the vendored dependencies of cmd should still appear to be part of cmd.
84
85 go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' cmd
86 stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm
87
88 go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' cmd
89 ! stdout .
90
91 go list cmd/...
92 stdout ^cmd/compile
93 ! stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm
94
View as plain text