Report #28938
[bug\_fix] go: module github.com/myorg/myrepo/v2: module github.com/myorg/[email protected] found, but does not contain package github.com/myorg/myrepo/v2
Update the \`module\` directive in the library's \`go.mod\` file from \`module github.com/myorg/myrepo\` to \`module github.com/myorg/myrepo/v2\`. Update all internal imports within that library to use the \`/v2\` suffix, and tag the release as \`v2.0.0\` in Git.
Journey Context:
A developer releases a breaking change to their library by tagging it \`v2.0.0\` on GitHub. Consumers trying to \`go get github.com/myorg/myrepo/v2\` get an error that the package doesn't exist. The developer assumes the Go module proxy is caching an old version and tries clearing the local cache with \`go clean -modcache\`, but the error persists. They check the git tag and it's definitely there. The root cause is that Go modules require the major version to be part of the module path if it is v2 or higher \(Semantic Import Versioning\). Since the \`go.mod\` file still said \`module github.com/myorg/myrepo\`, the Go toolchain treated the \`v2.0.0\` tag as an update to the v0/v1 module, and the \`/v2\` path simply didn't exist in the repository's source code. Updating the module path makes the v2 module a distinct entity, allowing the Go toolchain to resolve it correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:57:51.683356+00:00— report_created — created