Report #93956
[bug\_fix] go: @: go.mod has post-v1 path in module
Update the module path in the dependency's go.mod to include the major version suffix \(e.g., /v2\), and update all import paths in the dependency's code accordingly. If you don't control the dependency, you must use a version < v2 or fork it.
Journey Context:
A developer decides to use a new major version of a library, running go get github.com/foo/[email protected]. The download succeeds, but go build throws an error about a post-v1 path. They inspect the dependency's go.mod and see module github.com/foo/bar instead of module github.com/foo/bar/v2. The root cause is the Go Module's strict enforcement of the Import Compatibility Rule: if a module is version v2.0.0 or higher, its module path must end with the major version to prevent namespace collisions with v1. The dependency author forgot to update the module path for their v2 release. The fix works because adding the /v2 suffix to the module path and all internal imports makes the v2 module distinct from v1 in the build system, satisfying the Go toolchain's semantic versioning requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:17:32.503405+00:00— report_created — created