...
1# If 'go get -u' finds an upgrade candidate that isn't viable,
2# but some other upgraded module's requirement moves past it
3# (for example, to a higher prerelease), then we should accept
4# the transitive upgrade instead of trying lower roots.
5
6go get -v -u . example.net/b@v0.1.0
7cmp go.mod go.mod.want
8
9-- go.mod --
10module example
11
12go 1.17
13
14require (
15 example.net/a v0.1.0
16 example.net/b v0.1.0
17 example.net/c v0.1.0
18)
19
20replace (
21 example.net/a v0.1.0 => ./a1
22 example.net/a v0.2.0-pre => ./a2p
23 example.net/b v0.1.0 => ./b
24 example.net/b v0.2.0 => ./b
25 example.net/c v0.1.0 => ./c1
26 example.net/c v0.2.0 => ./c2
27)
28-- go.mod.want --
29module example
30
31go 1.17
32
33require (
34 example.net/a v0.2.0-pre
35 example.net/b v0.1.0
36 example.net/c v0.2.0
37)
38
39replace (
40 example.net/a v0.1.0 => ./a1
41 example.net/a v0.2.0-pre => ./a2p
42 example.net/b v0.1.0 => ./b
43 example.net/b v0.2.0 => ./b
44 example.net/c v0.1.0 => ./c1
45 example.net/c v0.2.0 => ./c2
46)
47-- example.go --
48package example
49
50import (
51 _ "example.net/a"
52 _ "example.net/b"
53 _ "example.net/c"
54)
55-- a1/go.mod --
56module example.net/a
57
58go 1.17
59
60require example.net/b v0.2.0
61-- a1/a.go --
62package a
63
64import _ "example.net/b"
65-- a2p/go.mod --
66module example.net/a
67
68go 1.17
69-- a2p/a.go --
70package a
71-- b/go.mod --
72module example.net/b
73
74go 1.17
75-- b/b.go --
76package b
77-- c1/go.mod --
78module example.net/c
79
80go 1.17
81
82require example.net/a v0.1.0
83-- c1/c.go --
84package c
85
86import _ "example.net/a"
87-- c2/go.mod --
88module example.net/c
89
90go 1.17
91
92require example.net/a v0.2.0-pre
93-- c2/c.go --
94package c
95
96import _ "example.net/c"
View as plain text