@@ -11,7 +11,10 @@ cp $WORK/modules-1.13.txt $WORK/auto/modules.txt
11
11
# An explicit -mod=vendor should force use of the vendor directory.
12
12
env GOFLAGS=-mod=vendor
13
13
14
- go list -f {{.Dir}} -tags tools all
14
+ # Pass -e to permit an error: tools.go imports a main package
15
+ # "example.com/printversion".
16
+ # TODO(#59186): investigate why it didn't fail without -e.
17
+ go list -f {{.Dir}} -tags tools -e all
15
18
stdout '^'$WORK'[/\\]auto$'
16
19
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
17
20
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
@@ -25,7 +28,7 @@ stderr 'go: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod
25
28
# An explicit -mod=mod should force the vendor directory to be ignored.
26
29
env GOFLAGS=-mod=mod
27
30
28
- go list -f {{.Dir}} -tags tools all
31
+ go list -f {{.Dir}} -tags tools -e all
29
32
stdout '^'$WORK'[/\\]auto$'
30
33
stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]
[email protected] $'
31
34
stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
@@ -44,7 +47,7 @@ stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
44
47
env GOFLAGS=
45
48
go mod edit -go=1.13
46
49
47
- go list -f {{.Dir}} -tags tools all
50
+ go list -f {{.Dir}} -tags tools -e all
48
51
stdout '^'$WORK'[/\\]auto$'
49
52
stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]
[email protected] $'
50
53
stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
75
78
# An explicit -mod=mod should still force the vendor directory to be ignored.
76
79
env GOFLAGS=-mod=mod
77
80
78
- go list -f {{.Dir}} -tags tools all
81
+ go list -f {{.Dir}} -tags tools -e all
79
82
stdout '^'$WORK'[/\\]auto$'
80
83
stdout '^'$GOPATH'[/\\]pkg[/\\]mod[/\\]example.com[/\\]
[email protected] $'
81
84
stdout '^'$WORK'[/\\]auto[/\\]replacement-version$'
@@ -97,7 +100,7 @@ env GOFLAGS=
97
100
go mod edit -go=1.14
98
101
go mod vendor
99
102
100
- go list -f {{.Dir}} -tags tools all
103
+ go list -f {{.Dir}} -tags tools -e all
101
104
stdout '^'$WORK'[/\\]auto$'
102
105
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
103
106
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
@@ -120,7 +123,7 @@ rm go.mod
120
123
rm vendor/modules.txt
121
124
122
125
go mod init example.com/auto
123
- go list -f {{.Dir}} -tags tools all
126
+ go list -f {{.Dir}} -tags tools -e all
124
127
stdout '^'$WORK'[/\\]auto$'
125
128
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
126
129
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
@@ -130,7 +133,7 @@ stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
130
133
131
134
cp go.mod.orig go.mod
132
135
go mod edit -go=1.14
133
- ! go list -f {{.Dir}} -tags tools all
136
+ ! go list -f {{.Dir}} -tags tools -e all
134
137
stderr '^go: inconsistent vendoring in '$WORK[/\\]auto':$'
135
138
stderr '^\texample.com/
[email protected] : is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt'
136
139
stderr '^\texample.com/unused: is replaced in go.mod, but not marked as replaced in vendor/modules.txt'
@@ -141,7 +144,7 @@ stderr '^\tTo ignore the vendor directory, use -mod=readonly or -mod=mod.\n\tTo
141
144
# the go version is 1.13 or earlier.
142
145
# An incomplete or missing vendor/modules.txt should resolve the vendored packages...
143
146
go mod edit -go=1.13
144
- go list -mod=vendor -f {{.Dir}} -tags tools all
147
+ go list -mod=vendor -f {{.Dir}} -tags tools -e all
145
148
stdout '^'$WORK'[/\\]auto$'
146
149
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
147
150
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
@@ -158,7 +161,7 @@ stderr '^\tTo ignore the vendor directory, use -mod=readonly or -mod=mod.\n\tTo
158
161
go mod vendor
159
162
cmp $WORK/modules-1.13.txt vendor/modules.txt
160
163
161
- go list -mod=vendor -f {{.Dir}} -tags tools all
164
+ go list -mod=vendor -f {{.Dir}} -tags tools -e all
162
165
stdout '^'$WORK'[/\\]auto$'
163
166
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
164
167
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
@@ -170,7 +173,7 @@ go mod vendor
170
173
cmp $WORK/modules-1.14.txt vendor/modules.txt
171
174
172
175
# Then, -mod=vendor should kick in automatically and succeed.
173
- go list -f {{.Dir}} -tags tools all
176
+ go list -f {{.Dir}} -tags tools -e all
174
177
stdout '^'$WORK'[/\\]auto$'
175
178
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]printversion$'
176
179
stdout '^'$WORK'[/\\]auto[/\\]vendor[/\\]example.com[/\\]version$'
0 commit comments