@@ -25,8 +25,6 @@ stderr 'cannot find main module'
25
25
go list all
26
26
! stdout .
27
27
stderr 'warning: "all" matched no packages'
28
- go list -m all
29
- stderr 'warning: pattern "all" matched no module dependencies'
30
28
31
29
# 'go list' on standard-library packages should work, since they do not depend
32
30
# on the contents of any module.
@@ -49,10 +47,13 @@ stdout 'example.com/version v1.1.0'
49
47
go list -m -versions example.com/version
50
48
stdout 'v1.0.0\s+v1.0.1\s+v1.1.0'
51
49
52
- # 'go list -m <mods> all' does not include the dependencies of <mods> in the computation of 'all'.
53
- go list -m example.com/
[email protected] all
54
- stdout 'example.com/printversion v1.0.0'
55
- stderr 'warning: pattern "all" matched no module dependencies'
50
+ # 'go list -m all' should fail. "all" is not meaningful outside of a module.
51
+ ! go list -m all
52
+ stderr 'go: cannot match "all": working directory is not part of a module'
53
+
54
+ # 'go list -m <mods> all' should also fail.
55
+ ! go list -m example.com/
[email protected] all
56
+ stderr 'go: cannot match "all": working directory is not part of a module'
56
57
! stdout 'example.com/version'
57
58
58
59
87
88
exists $GOPATH/pkg/mod/cache/download/example.com/printversion/@v/v1.0.0.zip
88
89
! exists $GOPATH/pkg/mod/cache/download/example.com/version/@v/v1.0.0.zip
89
90
91
+ # 'go mod download all' should fail. "all" is not meaningful outside of a module.
92
+ ! go mod download all
93
+ stderr 'go: cannot match "all": working directory is not part of a module'
94
+
90
95
# 'go mod vendor' should fail: it starts by clearing the existing vendor
91
96
# directory, and we don't know where that is.
92
97
! go mod vendor
@@ -109,9 +114,8 @@ stderr 'cannot find main module'
109
114
110
115
# 'go get -u all' upgrades the transitive import graph of the main module,
111
116
# which is empty.
112
- go get -u all
113
- ! stdout .
114
- stderr 'warning: "all" matched no packages'
117
+ ! go get -u all
118
+ stderr 'go get all: cannot match "all": working directory is not part of a module'
115
119
116
120
# 'go get' should check the proposed module graph for consistency,
117
121
# even though we won't write it anywhere.
0 commit comments