1 env GO111MODULE=on
2
3 go get rsc.io/quote@v1.5.1
4 go mod vendor
5 env GOPATH=$WORK/empty
6 env GOPROXY=file:///nonexist
7
8 go list -mod=vendor
9 go list -mod=vendor -f '{{with .Module}}{{.Path}} {{.Version}}{{end}} {{.Dir}}' all
10 stdout '^rsc.io/quote v1.5.1 .*vendor[\\/]rsc.io[\\/]quote$'
11 stdout '^golang.org/x/text v0.0.0.* .*vendor[\\/]golang.org[\\/]x[\\/]text[\\/]language$'
12
13 ! go list -mod=vendor -m rsc.io/quote@latest
14 stderr 'go: rsc.io/quote@latest: cannot query module due to -mod=vendor'
15 ! go get -mod=vendor -u
16 stderr '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
21 stderr '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 ...
23 stderr 'go: can''t match module patterns using the vendor directory\n\t\(Use -mod=mod or -mod=readonly to bypass.\)'
24
25 -- go.mod --
26 module x
27
28 go 1.16
29 -- x.go --
30 package x
31 import _ "rsc.io/quote"
32
View as plain text