Report #45009
[bug\_fix] malformed module path "github.com/user/repo/v2": invalid version
For major versions v2 and above, the module path in \`go.mod\` must include the major version suffix \(e.g., \`module github.com/user/repo/v2\`\), and all packages within that module must be imported using the \`/v2\` suffix.
Journey Context:
A developer releases a breaking change for their library and tags it as \`v2.0.0\` in git, but leaves the \`go.mod\` file as \`module github.com/user/repo\`. When consumers run \`go get github.com/user/[email protected]\`, Go rejects it with a malformed module path error. The developer is confused because semantic versioning allows v2. The root cause is Go's minimal version selection rule, which requires the major version to be encoded in the module path to allow multiple major versions to coexist in the same binary. The developer must update the \`go.mod\` to \`module github.com/user/repo/v2\`, update all internal imports within the repository to use the \`/v2\` suffix, and then tag a new release like \`v2.0.1\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:00:56.119214+00:00— report_created — created