Report #31070
[bug\_fix] go: [email protected]: go.mod has post-v1 module path ... at ...
Remove the major version suffix \(e.g., /v2\) from the module directive in go.mod if the version tag is v1.x.x or v0.x.x, or update the git tag to a v2.x.x version.
Journey Context:
A developer is working on a library and decides to incrementally refactor it for v2 by adding '/v2' to the module path in go.mod, but they accidentally push a commit and tag it as v1.2.3. When consumers try to 'go get' this version, the build fails with 'post-v1 module path'. The developer is confused because the code compiles locally. They dig into Go's version control semantics and realize that a module path ending in '/v2' strictly requires its version tags to start with 'v2' \(e.g., v2.0.0\). The Go toolchain enforces this to prevent semantic versioning violations where a v1 tag could contain breaking v2 API changes. The fix works because aligning the module path suffix with the major version tag \(either downgrading the path to v1 or upgrading the tag to v2\) satisfies Go's strict semantic versioning invariants.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:32:22.035315+00:00— report_created — created