gnostic
gnostic copied to clipboard
Error parsing go.mod module declares its path as: github.com/google/gnostic but was required as: github.com/googleapis/gnostic
Hi,
the recent change of the module name (from googleapis to google) causes the go get -u ./... command to fail in our project where gnostic is listed as an indirect dependency.
go get: github.com/googleapis/[email protected]: parsing go.mod:
module declares its path as: github.com/google/gnostic
but was required as: github.com/googleapis/gnostic
https://github.com/google/gnostic/pull/259
Manually changing the name and version in the mod file doesn't help.
Is there a recommended smooth update path?
There isn't a good workaround at the moment for renaming GitHub repositories without breaking Go module users.
I suggest rolling back the name change until https://github.com/golang/go/issues/26904 and/or https://github.com/golang/go/issues/30831 is fixed in the Go toolchain, or moving the repository back to its original name and starting a new (separate) repository for the github.com/google/gnostic path.
Thanks for the answer and the link @bcmills, it's comforting to see that I'm not the only one struggling with this :) What is your preferred solution then? Rolling back the change is quite easier, I'm not sure how long it will take for one of the two PRs above to be merged.
Any news about fixing this? I've got bitten when trying to upgrade the dependencies of a project and now this repo reshuffle blocks this as an indirect dependency stopping go get -u. Please undo this, please!
The issue goes away when upgrading to go 1.17.3, at least for me.
Depending on your product build requirements you cannot simply update go just because some module decided to break its import path, and this change has already propagated into other modules depending on it, so projects end up in a dependency hell. This is exactly I was warned of: go modules not being mature and go being not ripe for productivity with lots of complex dependencies. I have to admit: the critics are right on spot here.
I just thought I would mention it in case someone has the opportunity to upgrade go. If you have to stay on the same golang version, then obviously that solution doesn't help you :(
The issue goes away when upgrading to go 1.17.3, at least for me.
Not for me
The issue goes away when upgrading to go 1.17.3, at least for me.
Not for me
Not for me too, is there any other solution ?
The issue goes away when upgrading to go 1.17.3, at least for me.
Not for me
Not for me too, is there any other solution ?
Atleast error went away after adding this to replases: github.com/googleapis/gnostic => github.com/google/gnostic v0.5.7-0.20211028223514-b1b34ea319d3
The issue goes away when upgrading to go 1.17.3, at least for me.
Not for me
Not for me too, is there any other solution ?
Atleast error went away after adding this to replases: github.com/googleapis/gnostic => github.com/google/gnostic v0.5.7-0.20211028223514-b1b34ea319d3
thanks, I add this to replaces : github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5. the error went away.
The error goes away with the replace github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5
but I seem to reach other issues when I roll back the gnostic version
#22 48.70 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:79:12: undefined: logr.WithCallDepth```
The error goes away with the
replace github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5but I seem to reach other issues when I roll back the gnostic version
#22 48.70 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:79:12: undefined: logr.WithCallDepth```
if you don't need latest k8s, maybe you can rollback its version too.
The issue goes away when upgrading to go 1.17.3, at least for me.
Only works if you also change go.mod go be go 1.17 and after that does go mod tidy before upping whatever needs to be upgraded :)
I had the same issue with the package name, after searching a lot I found golang cache coming from golang proxy server, after rewriting GOPROXY variable to GOPROXY="direct" everything starts working.
Got following message from @dependabot
⚠️ Dependabot wasn't able to update downloading
The module path downloading found in your go.mod doesn't match the actual path
github.com/google/gnosticfound in the dependency'sgo.mod.Updating the module path in your
go.modtogithub.com/google/gnosticshould resolve this issue.