Closed retgits closed 4 years ago
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
Change https://golang.org/cl/227097 mentions this issue: cmd/go: report original module path in error parsing replaced go.mod
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.