Report #76683
[bug\_fix] go: github.com/user/[email protected]: invalid version: module path github.com/user/repo at version v2.0.0 should be github.com/user/repo/v2
Append the major version suffix \(e.g., \`/v2\`\) to the \`module\` directive in the dependency's \`go.mod\`, update all internal import paths within that dependency to include the suffix, and update the import paths in the consuming project to \`github.com/user/repo/v2\`. Then release a new tag \(e.g., \`v2.0.1\`\).
Journey Context:
A library author releases a major breaking change, tagging their repository as \`v2.0.0\` in Git. A consumer tries to update their project via \`go get github.com/user/[email protected]\`, but the build fails with the 'invalid version' error. The author is confused because the tag clearly exists. They try deleting the tag and re-pushing, to no avail. The root cause is Go's Semantic Import Versioning \(SIV\) rule: starting from version v2.0.0, the major version must be explicitly included in the module path. The Go toolchain enforces this strictly; a \`v2.x.x\` tag without a \`/v2\` module path is considered invalid to prevent accidental major version upgrades. The fix requires the library author to update their \`go.mod\` to \`module github.com/user/repo/v2\`, update all internal package imports to use the \`/v2\` suffix, and tag a new release. The consumer must then import it as \`github.com/user/repo/v2\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:18:03.674523+00:00— report_created — created