github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_get_downgrade.txt (about) 1 env GO111MODULE=on 2 [short] skip 3 4 # downgrade sampler should downgrade quote 5 cp go.mod.orig go.mod 6 go get rsc.io/sampler@v1.0.0 7 go list -m all 8 stdout 'rsc.io/quote v1.4.0' 9 stdout 'rsc.io/sampler v1.0.0' 10 11 # downgrade sampler away should downgrade quote further 12 go get rsc.io/sampler@none 13 go list -m all 14 stdout 'rsc.io/quote v1.3.0' 15 16 # downgrade should report inconsistencies and not change go.mod 17 go get rsc.io/quote@v1.5.1 18 go list -m all 19 stdout 'rsc.io/quote v1.5.1' 20 stdout 'rsc.io/sampler v1.3.0' 21 ! go get rsc.io/sampler@v1.0.0 rsc.io/quote@v1.5.2 golang.org/x/text@none 22 stderr 'go get: inconsistent versions:\n\trsc.io/quote@v1.5.2 requires golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c \(not golang.org/x/text@none\), rsc.io/sampler@v1.3.0 \(not rsc.io/sampler@v1.0.0\)' 23 go list -m all 24 stdout 'rsc.io/quote v1.5.1' 25 stdout 'rsc.io/sampler v1.3.0' 26 27 # go get -u args should limit upgrades 28 cp go.mod.empty go.mod 29 go get -u rsc.io/quote@v1.4.0 rsc.io/sampler@v1.0.0 30 go list -m all 31 stdout 'rsc.io/quote v1.4.0' 32 stdout 'rsc.io/sampler v1.0.0' 33 ! stdout golang.org/x/text 34 35 # downgrading away quote should also downgrade away latemigrate/v2, 36 # since there are no older versions. v2.0.0 is incompatible. 37 cp go.mod.orig go.mod 38 go list -m -versions example.com/latemigrate/v2 39 stdout v2.0.0 # proxy may serve incompatible versions 40 go get rsc.io/quote@none 41 go list -m all 42 ! stdout 'example.com/latemigrate/v2' 43 44 -- go.mod.orig -- 45 module x 46 require ( 47 rsc.io/quote v1.5.1 48 example.com/latemigrate/v2 v2.0.1 49 ) 50 -- go.mod.empty -- 51 module x 52 -- x.go -- 53 package x