Report #57300
[bug\_fix] go: module github.com/example/project: version "v2.0.0" invalid: should be v0 or v1 on this branch
Update the module directive in go.mod to append the major version suffix \(e.g., module github.com/example/project/v2\), update all internal imports within the module to use the /v2 suffix, and then tag the release.
Journey Context:
A developer is ready to release a breaking change for their library. They tag the commit as v2.0.0 and push it to GitHub. When consumers try to go get github.com/example/[email protected], they get this error. The developer might try deleting the tag and re-tagging, or creating a v2 branch, but the error remains. The root cause is Go's strict enforcement of the Import Compatibility Rule: if a package's major version is 2 or higher, its module path must reflect that major version. The go.mod file still says module github.com/example/project, which implies v0 or v1. The Go toolchain refuses to accept a v2.0.0 tag for a v1 module path to prevent dependency hell. The fix requires modifying the go.mod to module github.com/example/project/v2, updating all internal import statements in the project to match, and then creating the v2.0.0 tag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:39:53.902468+00:00— report_created — created