| 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 |
| 9 |
stderr '^go: example.net/a@patch \(v0.1.1\) indirectly requires example.net/[email protected], not example.net/a@patch \(v0.1.1\)$' # TODO: A mention of b v0.1.0 would be nice. |
| 10 |
|
| 11 |
-- go.mod -- |
| 12 |
module example |
| 13 |
|
| 14 |
go 1.16 |
| 15 |
|
| 16 |
require example.net/a v0.1.0 |
| 17 |
|
| 18 |
replace ( |
| 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 -- |
| 25 |
package example |
| 26 |
|
| 27 |
import _ "example.net/a" |
| 28 |
|
| 29 |
-- a10/go.mod -- |
| 30 |
module example.net/a |
| 31 |
|
| 32 |
go 1.16 |
| 33 |
-- a10/a.go -- |
| 34 |
package a |
| 35 |
|
| 36 |
-- a11/go.mod -- |
| 37 |
module example.net/a |
| 38 |
|
| 39 |
go 1.16 |
| 40 |
|
| 41 |
require example.net/b v0.1.0 |
| 42 |
-- a11/a.go -- |
| 43 |
package a |
| 44 |
|
| 45 |
import _ "example.net/b" |
| 46 |
|
| 47 |
-- a20/go.mod -- |
| 48 |
module example.net/a |
| 49 |
|
| 50 |
go 1.16 |
| 51 |
-- a20/a.go -- |
| 52 |
package a |
| 53 |
|
| 54 |
|
| 55 |
-- b10/go.mod -- |
| 56 |
module example.net/b |
| 57 |
|
| 58 |
go 1.16 |
| 59 |
|
| 60 |
require example.net/a v0.2.0 |
| 61 |
-- b10/b.go -- |
| 62 |
package b |
| 63 |
|
| 64 |
import _ "example.net/a" |