github.com/zxy12/go_duplicate_112_new@v0.0.0-20200807091221-747231827200/src/cmd/go/testdata/script/mod_get_local.txt (about) 1 # Test 'go get' with a local module with a name that is not valid for network lookup. 2 3 env GO111MODULE=on 4 go mod edit -fmt 5 cp go.mod go.mod.orig 6 7 # 'go get -u -m' within the main module should work, even if it has a local-only name. 8 cp go.mod.orig go.mod 9 go get -u -m 10 grep 'rsc.io/quote.*v1.5.2' go.mod 11 grep 'golang.org/x/text.*v0.3.0' go.mod 12 cp go.mod go.mod.implicitmod 13 14 # 'go get -u -m' with the name of the main module should be equivalent to 15 # 'go get -u -m' without any further arguments. 16 cp go.mod.orig go.mod 17 go get -u -m local 18 cmp go.mod go.mod.implicitmod 19 20 # 'go get -u -d' in the empty root of the main module should update the 21 # dependencies of all packages in the module. 22 cp go.mod.orig go.mod 23 go get -u -d 24 cmp go.mod go.mod.implicitmod 25 26 # 'go get -u -d .' within a package in the main module updates all dependencies 27 # of the main module. 28 # TODO: Determine whether that behavior is a bug. 29 # (https://golang.org/issue/26902) 30 cp go.mod.orig go.mod 31 cd uselang 32 go get -u -d . 33 cd .. 34 grep 'rsc.io/quote.*v1.5.2' go.mod 35 grep 'golang.org/x/text.*v0.3.0' go.mod 36 cp go.mod go.mod.dotpkg 37 38 # 'go get -u -d' with an explicit package in the main module updates 39 # all dependencies of the main module. 40 # TODO: Determine whether that behavior is a bug. 41 # (https://golang.org/issue/26902) 42 cp go.mod.orig go.mod 43 go get -u -d local/uselang 44 cmp go.mod go.mod.dotpkg 45 46 47 -- go.mod -- 48 module local 49 50 require ( 51 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c 52 rsc.io/quote v1.3.0 53 ) 54 55 -- uselang/uselang.go -- 56 package uselang 57 import _ "golang.org/x/text/language" 58 59 -- usequote/usequote.go -- 60 package usequote 61 import _ "rsc.io/quote"