Skip to content
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

cmd/go: require and replace doesn't seem to like uppercase #31437

Closed
ryandawsonuk opened this issue Apr 12, 2019 · 3 comments
Closed

cmd/go: require and replace doesn't seem to like uppercase #31437

ryandawsonuk opened this issue Apr 12, 2019 · 3 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@ryandawsonuk
Copy link

I was trying to use a submodule under a relative path and set up the go.mod to do a replace like in https://stackoverflow.com/questions/52079662/go-get-cannot-find-local-packages-when-using-modules

In my case the github organisation name has an uppercase in it. So think github.com/Org/repo/proj/submod But the error when I did a go build from the top-level came out with:

build github.com/org/repo/proj: cannot load github.com/org/repo/proj/submod: cannot find module providing package github.com/org/repo/proj/submod

I then changed the require and replace statements in the top-level go.mod to refer to the submodule with the all-lowercase and then it worked.

go version go1.12.1 linux/amd64

Issue similar to #26208 and #27157

@rsc
Copy link
Contributor

rsc commented Apr 12, 2019

build github.com/org/repo/proj: cannot load github.com/org/repo/proj/submod: cannot find module providing package github.com/org/repo/proj/submod

This message is saying "build : cannot load : reason". It sounds like (1) your go.mod in github.com/org/repo says 'module github.com/org/repo' with lowercase org, and (2) github.com/org/repo/proj contains a Go import of "github.com/org/repo/proj/submod", again with lowercase org.

What matters is what's in the go.mod file and what is in the import statements. It sounds like they are both lowercase.

Without details it's hard to say more.

@rsc rsc changed the title require and replace doesn't seem to like uppercase cmd/go: require and replace doesn't seem to like uppercase Apr 12, 2019
@bcmills
Copy link
Contributor

bcmills commented Apr 12, 2019

If the case in the module directive doesn't match the case in the import statement, part of the stderr output should at least clearly diagnose that condition. @ryandawsonuk, what was the complete output of go build?

(This situation should already be improved at head by @jayconrod's diagnostic changes for #28489.)

@bcmills bcmills added modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Apr 12, 2019
@bcmills bcmills added this to the Go1.13 milestone Apr 12, 2019
@ryandawsonuk
Copy link
Author

ryandawsonuk commented Apr 15, 2019

Sorry you are right. It does work for me now - I must have had some mismatch. Thanks for your help.

@golang golang locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants