1 env GO111MODULE=off
2
3 [!gc] skip
4 [short] skip
5
6 # Listing GOROOT should only find standard packages.
7 cd $GOROOT/src
8 go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' ./...
9 ! stdout .
10
11 # Standard packages should include cmd, but not cmd/vendor.
12 go list ./...
13 stdout cmd/compile
14 ! stdout vendor/golang.org
15 ! stdout cmd/vendor
16
17 # In GOPATH mode, packages vendored into GOROOT should be reported as standard.
18 go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' std cmd
19 stdout golang.org/x/net/http2/hpack
20 stdout cmd/vendor/golang\.org/x/arch/x86/x86asm
21
22 # However, vendored packages should not match wildcard patterns beginning with cmd.
23 go list cmd/...
24 stdout cmd/compile
25 ! stdout cmd/vendor
26
View as plain text