gnostic: 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/gnostic@v0.5.6: 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?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 41
  • Comments: 15

Commits related to this issue

Most upvoted comments

The issue goes away when upgrading to go 1.17.3, at least for me.

Not for me

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.

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.

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 issue goes away when upgrading to go 1.17.3, at least for me.

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/controller-runtime@v0.10.3/pkg/log/deleg.go:79:12: undefined: logr.WithCallDepth```