Report #56756
[bug\_fix] go: github.com/user/[email protected]: invalid version: module path "github.com/user/module" must have major version suffix "v2"
Append /v2 to the module path in the dependency's go.mod file \(e.g., \`module github.com/user/module/v2\`\), update all internal imports within that module to use the /v2 suffix, and tag the release as v2.0.0. Then import it as \`github.com/user/module/v2\` in the consuming project.
Journey Context:
A developer releases version 2.0.0 of their library. They tag it v2.0.0 in Git. When another developer tries to \`go get github.com/user/[email protected]\`, they get the 'invalid version: module path must have major version suffix' error. The library author thinks they just need to use the @v2.0.0 version in go get, and goes down a rabbit hole of deleting go.sum or clearing the module cache. The error persists. The root cause is Go's Semantic Import Versioning rule: if a module's major version is v2 or higher, the major version MUST be part of the module path. This ensures v1 and v2 are distinct modules, preventing the 'diamond dependency' problem. The fix works because updating the go.mod to \`module github.com/user/module/v2\` explicitly declares this as a new, incompatible module, allowing Go to safely manage v1 and v2 side-by-side.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:45:26.086829+00:00— report_created — created