Report #13342
[bug\_fix] go: @ used for two different module paths \( and \)
Check the \`replace\` directives in your go.mod. If pointing to a local directory, ensure the \`module\` directive in the local directory's go.mod exactly matches the module path on the left-hand side of the \`replace\` directive.
Journey Context:
A developer uses a \`replace\` directive in go.mod to point a third-party dependency to a local fork for debugging \(e.g., \`replace github.com/pkg/errors => ../errors\`\). When they run \`go build\`, they get an error about the module being used for two different paths. They might try changing the version number or removing the replace directive, which defeats their debugging goal. The root cause is that the local fork's go.mod file has a \`module\` line that doesn't match the path they are replacing \(e.g., the local go.mod says \`module errors\` instead of \`module github.com/pkg/errors\`\). Go detects this discrepancy and fails because allowing it would create ambiguous module identities in the dependency graph. Updating the local fork's go.mod module path to match the original fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:25:18.593803+00:00— report_created — created