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
22 ! go get rsc.io/sampler@v1.0.0 rsc.io/quote@v1.5.2 golang.org/x/text@none
23 ! stderr add|remove|upgrad|downgrad
24 stderr '^go: rsc.io/quote@v1.5.2 requires rsc.io/sampler@v1.3.0, not rsc.io/sampler@v1.0.0$'
25
26 go list -m all
27 stdout 'rsc.io/quote v1.5.1'
28 stdout 'rsc.io/sampler v1.3.0'
29
30 # go get -u args should limit upgrades
31 cp go.mod.empty go.mod
32 go get -u rsc.io/quote@v1.4.0 rsc.io/sampler@v1.0.0
33 go list -m all
34 stdout 'rsc.io/quote v1.4.0'
35 stdout 'rsc.io/sampler v1.0.0'
36 ! stdout golang.org/x/text
37
38 # downgrading away quote should also downgrade away latemigrate/v2,
39 # since there are no older versions. v2.0.0 is incompatible.
40 cp go.mod.orig go.mod
41 go list -m -versions example.com/latemigrate/v2
42 stdout v2.0.0 # proxy may serve incompatible versions
43 go get rsc.io/quote@none
44 go list -m all
45 ! stdout 'example.com/latemigrate/v2'
46
47 -- go.mod.orig --
48 module x
49 require (
50 rsc.io/quote v1.5.1
51 example.com/latemigrate/v2 v2.0.1
52 )
53 -- go.mod.empty --
54 module x
55 -- x.go --
56 package x
57
View as plain text