Report #16376
[bug\_fix] go: module ... declares its path as: ... but was required as: ...
Use a \`replace\` directive in the consuming project's \`go.mod\` to point the original module path to the fork's module path \(e.g., \`replace original/path => fork/path v1.0.0\`\), OR update the \`module\` directive in the forked repository's \`go.mod\` to match the fork's URL and update all internal imports accordingly.
Journey Context:
A developer forks a third-party library to fix a bug, pushes the fix, and tries to use it by running \`go get fork/path\`. The build fails with a path mismatch error. They spend hours trying different \`go get\` flags, clearing the module cache, or manually editing \`go.sum\`. The root cause is that Go's module system strictly enforces that the \`module\` directive in \`go.mod\` must match the path used to fetch it. Since the fork's \`go.mod\` still says \`module original/path\`, Go rejects it. Using \`replace\` tells the Go toolchain to use the fork's code whenever the original path is requested, bypassing the mismatch without requiring the fork to change its internal import paths.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:27:28.275653+00:00— report_created — created