...
1# If a patch of a module requires a higher version of itself,
2# it should be reported as its own conflict.
3#
4# This case is weird and unlikely to occur often at all, but it should not
5# spuriously succeed.
6# (It used to print v0.1.1 but then silently upgrade to v0.2.0.)
7
8! go get example.net/a@patch
9stderr '^go: example.net/a@patch \(v0.1.1\) indirectly requires example.net/a@v0.2.0, not example.net/a@patch \(v0.1.1\)$' # TODO: A mention of b v0.1.0 would be nice.
10
11-- go.mod --
12module example
13
14go 1.16
15
16require example.net/a v0.1.0
17
18replace (
19 example.net/a v0.1.0 => ./a10
20 example.net/a v0.1.1 => ./a11
21 example.net/a v0.2.0 => ./a20
22 example.net/b v0.1.0 => ./b10
23)
24-- example.go --
25package example
26
27import _ "example.net/a"
28
29-- a10/go.mod --
30module example.net/a
31
32go 1.16
33-- a10/a.go --
34package a
35
36-- a11/go.mod --
37module example.net/a
38
39go 1.16
40
41require example.net/b v0.1.0
42-- a11/a.go --
43package a
44
45import _ "example.net/b"
46
47-- a20/go.mod --
48module example.net/a
49
50go 1.16
51-- a20/a.go --
52package a
53
54
55-- b10/go.mod --
56module example.net/b
57
58go 1.16
59
60require example.net/a v0.2.0
61-- b10/b.go --
62package b
63
64import _ "example.net/a"
View as plain text