Report #94950
[bug\_fix] go: module example.com/[email protected]: malformed module path: module path must have major version suffix matching major version v2
Append the major version suffix \(e.g., /v2\) to the module path in go.mod and all import statements.
Journey Context:
A developer attempts to upgrade a dependency from v1 to v2 by running \`go get example.com/[email protected]\`. The command succeeds, but the build fails with a path mismatch or malformed module path error. They attempt to use a \`replace\` directive in \`go.mod\` to force the v2 package into the v1 import path. This temporarily compiles locally but breaks CI and causes panics with transitive dependencies expecting the v1 interface. The root cause is Go's Semantic Import Versioning \(SIV\) rule, which mandates that packages with incompatible API changes must have distinct import paths to prevent two different major versions from being linked in the same binary. The fix works because appending \`/v2\` creates a completely distinct namespace, allowing the Go module loader to safely resolve and cache v2 alongside v1 without symbol conflicts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:57:15.821302+00:00— report_created — created