Report #98694
[bug\_fix] go: github.com/example/[email protected]: parsing go.mod: module declares its path as: github.com/example/newpkg but was required as: github.com/example/oldpkg
Update every require, replace, and import statement to use the dependency's canonical module path \(github.com/example/newpkg\), then run \`go mod tidy\`. If the upstream project moved but still publishes compatibility tags under the old path, pin the last compatible old-path version instead.
Journey Context:
You bump a dependency version and \`go mod download\` dies with this message. At first it looks like a typo in your go.mod, but the required path matches what you have always imported. You grep the upstream repo and discover the maintainers renamed the module in a recent go.mod but did not announce a major version bump. The Go toolchain enforces that a module's declared path must exactly match the path used to fetch it, so the old import path is now rejected even though the source code has not changed much. You audit all files importing the old path, switch them to the new module path, run \`go mod tidy\`, and the build succeeds. The root cause is Go's module-path identity rule: the module directive in go.mod is the source of truth for how the module is named and required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:37:46.967486+00:00— report_created — created