aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_list_std.txt
blob: baf7908ab93d2a946c5a8b4a1cb8c00ad816fdd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
env GO111MODULE=on
env GOPROXY=off

[!gc] skip
[short] skip

# Outside of GOROOT, our vendored packages should be reported as part of the standard library.
go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' std cmd
stdout ^vendor/golang\.org/x/net/http2/hpack
stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm
! stdout ^golang\.org/x/

# The dependencies of those packages should also be vendored.
go list -deps vendor/golang.org/x/crypto/chacha20
stdout ^vendor/golang\.org/x/crypto/internal/subtle

# cmd/... should match the same packages it used to match in GOPATH mode.
go list cmd/...
stdout ^cmd/compile
! stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm

# GOROOT/src/... should list the packages in std as if it were a module
# dependency: omitting vendored dependencies and stopping at the 'cmd' module
# boundary.

go list $GOROOT/src/...
stdout ^bytes$
! stdout ^builtin$
! stdout ^cmd/
! stdout ^vendor/
! stdout ^golang\.org/x/


# Vendored dependencies should appear with their 'vendor/' paths in std (they're
# in GOROOT/src, but not in the 'std' module following the usual module-boundary
# rules).

cd $GOROOT/src

go list std
stdout ^vendor/golang.org/x/net/http2/hpack
! stdout ^golang\.org/x

# The dependencies of packages with an explicit 'vendor/' prefix should
# still themselves resolve to vendored packages.
go list -deps vendor/golang.org/x/crypto/chacha20
stdout ^vendor/golang.org/x/crypto/internal/subtle
! stdout ^golang\.org/x

# Within the std module, the dependencies of the non-vendored packages within
# std should appear to come from modules, but they should be loaded from the
# vendor directory (just like ordinary vendored module dependencies).

go list all
stdout ^golang.org/x/
! stdout ^std/
! stdout ^cmd/
! stdout ^vendor/

go list -deps -f '{{if not .Standard}}{{.ImportPath}}{{end}}' std
! stdout ^vendor/golang.org/x/net/http2/hpack
stdout ^golang.org/x/net/http2/hpack

go list -f '{{.Dir}}' golang.org/x/net/http2/hpack
stdout $GOROOT[/\\]src[/\\]vendor

# Within the std module, the packages within the module should omit the 'std/'
# prefix (they retain their own identities), but should respect normal module
# boundaries (vendored packages are not included in the module, even though they
# are included in the 'std' pattern).

go list ./...
stdout ^bytes$
! stdout ^builtin$
! stdout ^cmd/
! stdout ^vendor/
! stdout ^golang\.org/x/


# Within std, the vendored dependencies of cmd should still appear to be part of cmd.

go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' cmd
stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm

go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' cmd
! stdout .

go list cmd/...
stdout ^cmd/compile
! stdout ^cmd/vendor/golang\.org/x/arch/x86/x86asm