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

Comments

Projects
None yet
3 participants
@ryandawsonuk
Copy link

commented Apr 12, 2019

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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.)

@ryandawsonuk

This comment has been minimized.

Copy link
Author

commented Apr 15, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.