You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I forked a project from https://github.com/wavefrontHQ/wavefront-lambda-go which doesn't use Go modules yet to help them adopt Go modules. I created a go.mod file, using
$ go mod init github.com/wavefrontHQ/wavefront-lambda-go
$ go mod tidy
$ go mod tidy
go: github.com/retgits/wavefront-lambda-go@v0.0.0-20200402161507-0edb5b9bfe10: parsing go.mod:
module declares its path as: github.com/wavefrontHQ/wavefront-lambda-go
but was required as: github.com/retgits/wavefront-lambda-go
The error message is a little misleading, and as @jayconrod discovered is about the capitalization of wavefrontHQ. After changing it all to lowercase in the module, it was solved.
The text was updated successfully, but these errors were encountered:
jayconrod
changed the title
Misleading error message when module name has capital letters
cmd/go: misleading error message for replacement module with capital letters
Apr 2, 2020
This error was also printed by go list -m all. Since it popped up during module loading, tools like go mod graph and go mod why weren't helpful for finding where the module was loaded (though in this case, it was loaded from the main module).
The error message should use the original module's path, not the replacement module path on the "required as" line.
go: github.com/retgits/wavefront-lambda-go@v0.0.0-20200402161507-0edb5b9bfe10: parsing go.mod:
module declares its path as: github.com/wavefrontHQ/wavefront-lambda-go
but was required as: github.com/wavefronthq/wavefront-lambda-go
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I forked a project from
https://github.com/wavefrontHQ/wavefront-lambda-go
which doesn't use Go modules yet to help them adopt Go modules. I created a go.mod file, usingThat results in the go.mod file
The resulting code was committed to the forked repo
https://github.com/retgits/wavefront-lambda-go
In a project where I want to use this new module, I added a replace directive into my go.mod file to point to the new location
Running any of the go commands throws an error
What did you expect to see?
What did you see instead?
The error message is a little misleading, and as @jayconrod discovered is about the capitalization of
wavefrontHQ
. After changing it all to lowercase in the module, it was solved.The text was updated successfully, but these errors were encountered: