github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_multirepo.txt (about) 1 env GO111MODULE=on 2 3 # initial standalone module should use no downloaded modules 4 go list -deps -f {{.Dir}} 5 ! stdout 'pkg[\\/]mod' 6 7 # v2 import should use a downloaded module 8 # both without an explicit go.mod entry ... 9 cp tmp/use_v2.go x.go 10 go list -deps -f {{.Dir}} 11 stdout 'pkg[\\/]mod[\\/]rsc.io[\\/]quote[\\/]v2@v2.0.1$' 12 13 # ... and with one ... 14 cp tmp/use_v2.mod go.mod 15 go list -deps -f {{.Dir}} 16 stdout 'pkg[\\/]mod[\\/]rsc.io[\\/]quote[\\/]v2@v2.0.1$' 17 18 # ... and even if there is a v2 module in a subdirectory. 19 mkdir v2 20 cp x.go v2/x.go 21 cp tmp/v2.mod v2/go.mod 22 go list -deps -f {{.Dir}} 23 stdout 'pkg[\\/]mod[\\/]rsc.io[\\/]quote[\\/]v2@v2.0.1$' 24 25 -- go.mod -- 26 module rsc.io/quote 27 28 -- x.go -- 29 package quote 30 31 -- tmp/use_v2.go -- 32 package quote 33 import _ "rsc.io/quote/v2" 34 35 -- tmp/use_v2.mod -- 36 module rsc.io/quote 37 require rsc.io/quote/v2 v2.0.1 38 39 -- tmp/v2.mod -- 40 package rsc.io/quote/v2