Report #48208
[bug\_fix] go: [email protected] has unexpected module path ...
Update the \`require\` directive in \`go.mod\` and all \`import\` statements in the source code to match the module path declared in the dependency's \`go.mod\` file. Remove any \`replace\` directives pointing the old path to the new path.
Journey Context:
A developer adds a dependency or updates an existing one using \`go get\`. The build fails, stating the module has an unexpected module path. They inspect the \`go.mod\` and see the required path is \`github.com/old/name\`, but the error says the dependency's \`go.mod\` declares itself as \`github.com/new/name\`. The developer realizes the upstream repository was renamed or moved, and Go strictly enforces that the path in \`require\` matches the \`module\` directive in the dependency's \`go.mod\`. They search their codebase for all instances of \`github.com/old/name\` in imports, replace them with \`github.com/new/name\`, and run \`go mod tidy\` to clean up the \`go.mod\` and \`go.sum\` files. They avoid using a \`replace\` directive as a crutch because it breaks for downstream consumers of their module.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:23:59.156326+00:00— report_created — created