github.com/hikaru7719/go@v0.0.0-20181025140707-c8b2ac68906a/src/cmd/go/testdata/script/mod_list_dir.txt (about) 1 # go list with path to directory should work 2 3 env GO111MODULE=off 4 go list -f '{{.ImportPath}}' $GOROOT/src/math 5 stdout ^math$ 6 7 env GO111MODULE=on 8 go list -f '{{.ImportPath}}' $GOROOT/src/math 9 stdout ^math$ 10 go list -f '{{.ImportPath}}' . 11 stdout ^x$ 12 ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 13 stderr '^go: no such directory.*quote@v1.5.2' 14 go mod download rsc.io/quote@v1.5.2 15 go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 16 stdout '^rsc.io/quote$' 17 go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0 18 stdout '^rsc.io/sampler$' 19 go get -d rsc.io/sampler@v1.3.1 20 go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.1 21 stdout '^rsc.io/sampler$' 22 ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0 23 stderr 'outside available modules' 24 25 -- go.mod -- 26 module x 27 require rsc.io/quote v1.5.2 28 29 -- x.go -- 30 package x