-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
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? Sign in to your account
go.mod failed to replace module #29608
Comments
This is working as designed. The canonical module path for the repository stored at |
But replacing to local works:
And the I am expecting the same behavior, from Git or from local. Why it must check the declared module name? |
Module replacements replace an original path with a new path. To correctly replace the paths for same-module imports within the module (such as this one), we must be able to identify those as same-module imports. That is, we must know what the module believes its own path to be, and the When you try to use Then, what happens if you then also add a See also #26607. |
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?
Init module
Create main.go
Add replace in
mod.go
And
go build
succeeds.Change
v0.3.0
tomaster
What did you expect to see?
Build OK.
Because it says (https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive):
What did you see instead?
go build
failed:The text was updated successfully, but these errors were encountered: