Report #101482
[bug\_fix] module declares its path as github.com/org/lib/v2 but was required as github.com/org/lib
For modules at major version 2 or higher, update the \`require\` directive to include the major-version suffix \(\`github.com/org/lib/v2 v2.x.y\`\) and change all imports in the codebase to use that suffixed path. Do not create a v2 subdirectory unless you also change the module path inside it.
Journey Context:
A maintainer tags a Go module \`v2.0.0\` without reading the semantic-import-versioning rule. Downstream consumers update their go.mod to \`github.com/org/lib v2.0.0\+incompatible\`, but Go 1.21 refuses to resolve it because the module's own go.mod declares \`module github.com/org/lib/v2\`. The consumer sees a confusing error about path mismatch. They try \`go get github.com/org/lib@latest\`, which still resolves to v1.x, and then attempt to vendor the code manually. The root cause is that Go modules require the import path to carry the \`/v2\` suffix for major versions beyond v1, mirroring the requirement in the module path. Once both the require directive and the imports are updated, version resolution works and \`go mod tidy\` no longer reports incompatibilities.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:55:56.958991+00:00— report_created — created