| 1 |
# Regression test for https://golang.org/issue/37438. |
| 2 |
# |
| 3 |
# If a path exists at the requested version, but does not exist at the |
| 4 |
# version of the module that is already required and does not exist at |
| 5 |
# the version that would be selected by 'go mod tidy', then |
| 6 |
# 'go get foo@requested' should resolve the requested version, |
| 7 |
# not error out on the (unrelated) latest one. |
| 8 |
|
| 9 |
go get example.net/a/[email protected] |
| 10 |
|
| 11 |
-- go.mod -- |
| 12 |
module example |
| 13 |
|
| 14 |
go 1.15 |
| 15 |
|
| 16 |
require example.net/a v0.1.0 |
| 17 |
|
| 18 |
replace ( |
| 19 |
example.net/a v0.1.0 => ./a1 |
| 20 |
example.net/a v0.2.0 => ./a2 |
| 21 |
example.net/a v0.3.0 => ./a1 |
| 22 |
) |
| 23 |
|
| 24 |
-- a1/go.mod -- |
| 25 |
module example.net/a |
| 26 |
|
| 27 |
go 1.15 |
| 28 |
-- a1/README -- |
| 29 |
package example.net/a/p does not exist at this version. |
| 30 |
|
| 31 |
-- a2/go.mod -- |
| 32 |
module example.net/a |
| 33 |
|
| 34 |
go 1.15 |
| 35 |
-- a2/p/p.go -- |
| 36 |
// Package p exists only at v0.2.0. |
| 37 |
package p |