-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: get fails to get a package when mod file has replace in a repo that imports packages from another go module in the same repository #35693
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
Comments
shouldn't the replacement path be |
Sure. Even if its so, that is not solving the issue that I am having |
based on the information you gave, your current setup (ignoring the go get) won't build because your replace points to some nonexistent directory if you fix the replace it will build and will go get properly (reason being it needs the entire dependency tree for version selection) |
May I know why api/lib is non existent directory ? |
your replace is |
This seems like a duplicate of #35273. |
Ah. I had to create an example as I cannot give away the structure I am actually using. but my local structure builds fine and go get fails at the last line of require section of go.mod |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes it does
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Here is my mod file contents
apiA mod contents
In the above mod file last line the the
require api v0.0.0-00010101000000-000000000000
is actually generated for the module in lib directoryEverything works fine as the code builds and runs fine but when I try to get a package from github with
go get github.com/spf13/[email protected]
What did you expect to see?
expected to get the package and add it to go.mod file
What did you see instead?
It throws below error
go: malformed module path "api/lib": missing dot in first path element
api/lib is referring to my module in lib directory and not sure why its making an http call to get api/lib though I used replace
The text was updated successfully, but these errors were encountered: