Report #2345
[bug\_fix] go: module github.com/example/project/v2: go.mod file declares module path as github.com/example/project
Update the 'module' directive in the dependency's go.mod file to append '/v2' \(e.g., 'module github.com/example/project/v2'\), update all internal imports within that module to use the '/v2' suffix, and ensure the git tag is 'v2.x.x'.
Journey Context:
A developer creates a new major version of their library, tags it v2.0.0 in git, and pushes it. Consumers running 'go get github.com/example/[email protected]' are met with this error. The developer wastes time checking git tags, remote caches, and even trying to delete their local go.sum. The rabbit hole ends when they realize Go's module system strictly enforces the Import Compatibility Rule: if the major version is 2 or higher, the module path must end in '/vN'. The go.mod file still declared the v1 path, causing the toolchain to reject the download because the requested path and the declared path did not match. Updating the module path fixes it because it aligns the declared identity with the requested identity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T11:19:22.318016+00:00— report_created — created