Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
B repo fork from the A repo and B repo add some codes that A repo doesn't have.
Try to import B in C with go mod.
go get B
Go will compliant and refuse to import B.
module declares its path as: A
but was required as: B
Because of B fork from A, it is no way to rename all the import paths which relevant to A since it will break the dependency.
And those users of B are painful to import B to their project, since go get refuse to import B, and they have to modify the go.mod by themselves.
go mod edit -replace A@latest=B@latest
It's like B is a second-class citizen.
I propose that go get can handle this scenario by add replace in go.mod and not refuse to import such repo.
Or maybe we can add a new flag go get -r to declare that the user wants to add a replacement explicitly.
go get -r
Also, currently, go get -u refuse to upgrade B repo even we already add replace in go.mod. Therefore I think go get -u should respect this if this proposal passed.
go get -u
The text was updated successfully, but these errors were encountered:
CC @bcmills @jayconrod
Sorry, something went wrong.
No branches or pull requests