Report #3884
[bug\_fix] module path must include major version suffix for v2\+ modules
Change the module path in the v2 library's go.mod to include \`/v2\` \(e.g., \`module github.com/foo/bar/v2\`\) and update all downstream import paths to the same \`/v2\` suffix. Do not bump the major version without changing the module path; otherwise Go resolves v1 code even though \`go.mod\` asks for v2.x.y.
Journey Context:
A team released v2.0.0 of an internal library and updated services to depend on it. Builds compiled, but services crashed because methods that existed only in v2 were missing at runtime. The developer checked \`go list -m all\` and saw \`github.com/foo/bar v2.0.0\+incompatible\`. Digging into the module cache revealed the actual compiled code was from the v1 branch. The root cause was that the library's \`go.mod\` still declared \`module github.com/foo/bar\` without the required \`/v2\` suffix, so Go treated v2 as an incompatible v1 release and pulled the latest v1 source. After the library authors changed the module path to \`github.com/foo/bar/v2\`, updated all internal imports, re-tagged v2.0.1, and consumers changed their imports to \`/v2\`, the correct code was resolved and the missing methods appeared.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:27:21.821239+00:00— report_created — created