Report #86494
[bug\_fix] module example.com/foo declares its path as example.com/bar but was required as example.com/foo
Ensure the \`module\` directive in the dependency's \`go.mod\` exactly matches the path used to require it. If using a fork, use a \`replace\` directive in the root \`go.mod\` to point the original import path to the fork's module path, or update the fork's \`module\` directive and all its internal import paths to match the new fork URL.
Journey Context:
A developer forks a popular library on GitHub to fix a bug. They update their project's \`go.mod\` to require the fork via a direct URL like \`github.com/dev/fork\`. The build fails with a path mismatch error. They spend hours checking Git tags and proxy settings, not realizing that the Go toolchain reads the \`module\` line inside the fork's \`go.mod\`, which still says \`module github.com/original/library\`. The toolchain strictly enforces that the \`require\` path matches the \`module\` directive to prevent spoofing. The fix is to add a \`replace github.com/original/library => github.com/dev/fork v0.0.0-...\` directive, allowing the code to import the original path while the toolchain substitutes the fork's source code, avoiding the need to rewrite every import path in the fork.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:46:16.134630+00:00— report_created — created