Report #101975
[bug\_fix] go: github.com/myfork/[email protected]: verifying module: module declares its path as: github.com/oldorg/foo but was required as: github.com/myfork/foo
Either edit the fork's go.mod to declare \`module github.com/myfork/foo\`, or, when consuming a temporary fork without renaming the module, add a \`replace\` directive in your own go.mod such as \`replace github.com/oldorg/foo => github.com/myfork/foo v1.2.3-patch\`, then run \`go mod tidy\`.
Journey Context:
You fork a public library to backport a fix and push a tag \`v1.2.3-patch\` under your own org. In your service you run \`go get github.com/myfork/[email protected]\`. The download succeeds, but \`go build\` fails with a message that the module declares its path as \`github.com/oldorg/foo\` yet was required as \`github.com/myfork/foo\`. You try changing your import paths to \`github.com/myfork/foo\`, but the error persists because the module's own \`go.mod\` is authoritative: Go treats the declared module path as the module's identity, independent of the URL it was fetched from. After re-reading the modules reference, you realize a fork must either rename its module path or be referenced through a \`replace\` directive that maps the original path to the fork's source. You add the \`replace\` for the temporary patch, verify with \`go list -m\`, and the build passes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:45:41.190405+00:00— report_created — created