...
1[short] skip
2
3# go list with path to directory should work
4
5# populate go.sum
6go get
7
8env GO111MODULE=off
9go list -f '{{.ImportPath}}' $GOROOT/src/math
10stdout ^math$
11
12env GO111MODULE=on
13go list -f '{{.ImportPath}}' $GOROOT/src/math
14stdout ^math$
15go list -f '{{.ImportPath}}' .
16stdout ^x$
17
18go mod download rsc.io/quote@v1.5.2
19go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
20stdout '^rsc.io/quote$'
21go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
22stdout '^rsc.io/sampler$'
23go get rsc.io/sampler@v1.3.1
24go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.1
25stdout '^rsc.io/sampler$'
26! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
27stderr 'outside main module or its selected dependencies'
28
29-- go.mod --
30module x
31require rsc.io/quote v1.5.2
32
33-- x.go --
34package x
35
36import _ "rsc.io/quote"
View as plain text