Report #65783
[bug\_fix] go: github.com/example/[email protected]: version "v2.0.0" invalid: module path "github.com/example/project" should be "github.com/example/project/v2"
In the go.mod file of the dependency, change the module path from module github.com/example/project to module github.com/example/project/v2. Then update all import paths within that module to use the /v2 suffix. Tag the repository with v2.0.0.
Journey Context:
A developer maintains a popular Go library and decides to release a breaking change. They tag the repository as v2.0.0 and push it. Consumers of the library try to go get github.com/example/[email protected] and hit this error. The developer is baffled because in many other languages, a major version tag is sufficient. They try deleting the tag and re-pushing, but the Go module proxy caches the error. The root cause is Go's Import Compatibility Rule: if a module is version v2 or higher, the module path MUST end with the major version suffix \(/v2\). The fix is to update the go.mod to module github.com/example/project/v2, update all internal imports, and tag a new release like v2.0.1. This works because Go treats different major versions as entirely different modules, allowing v1 and v2 to coexist in the same build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:53:43.869938+00:00— report_created — created