...
1env GO111MODULE=on
2
3go get rsc.io/quote@v1.5.1
4go mod vendor
5env GOPATH=$WORK/empty
6env GOPROXY=file:///nonexist
7
8go list -mod=vendor
9go list -mod=vendor -f '{{with .Module}}{{.Path}} {{.Version}}{{end}} {{.Dir}}' all
10stdout '^rsc.io/quote v1.5.1 .*vendor[\\/]rsc.io[\\/]quote$'
11stdout '^golang.org/x/text v0.0.0.* .*vendor[\\/]golang.org[\\/]x[\\/]text[\\/]language$'
12
13! go list -mod=vendor -m rsc.io/quote@latest
14stderr 'go: rsc.io/quote@latest: cannot query module due to -mod=vendor'
15! go get -mod=vendor -u
16stderr 'flag provided but not defined: -mod'
17
18# Since we don't have a complete module graph, 'go list -m' queries
19# that require the complete graph should fail with a useful error.
20! go list -mod=vendor -m all
21stderr 'go: can''t compute ''all'' using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
22! go list -mod=vendor -m ...
23stderr 'go: can''t match module patterns using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
24
25-- go.mod --
26module x
27
28go 1.16
29-- x.go --
30package x
31import _ "rsc.io/quote"
View as plain text