cmd/go: Replace a v2 mod where there isn't a v2 directory #49444
Labels
FrozenDueToAge
modules
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have two repositories, one library: https://github.com/shou1dwe/modoriginal with a
go.mod
like:Its go.mod contains a name different from its VCS location:
my.com/modoriginal
When using this library from another repository https://github.com/shou1dwe/modimport
A
replace
is required in go.mod like below:With this setup,
go run main.go
in modimport repository works fine, everything works.Then
my.com/modoriginal
author decided to introduce a breaking change and follow this guide: https://go.dev/blog/v2-go-modules, but decided to go with "major versions on separate branches" approach. So now there is https://github.com/shou1dwe/modoriginal/tree/v2 and also tagv2.0.0
created from the latest commit on v2 branch.And
modimport
tries to use the same approach to retrieve new v2 version ofmodoriginal
What did you expect to see?
go mod tidy
inmodimport
should exit 0 and returngo run main.go
inmodimport
should printprefix test
What did you see instead?
The text was updated successfully, but these errors were encountered: