Report #448
[bug\_fix] module declares its path as github.com/example/new but was required as github.com/example/old
Update the module directive in go.mod to the canonical path that matches the import statements and repository location. If this is major version v2 or later, the module path must end in /v2, /v3, etc., and every import path in the module must include that suffix. Run \`go mod tidy\` and rebuild.
Journey Context:
A teammate renamed the repository on GitHub from github.com/example/old to github.com/example/new but only updated the remote URL locally. \`go build\` suddenly fails with a message saying the module declares its path as the new name but was required as the old name. At first it looks like a caching issue, so you clear \`$GOCACHE\` and \`go clean -modcache\`, but the error persists. Inspecting the source shows the go.mod file still says \`module github.com/example/old\`, while consumers and the new git remote expect \`github.com/example/new\`. The mismatch arises because Go validates the identity declared in the module directive against the import path used to fetch it. Once the \`module\` line is corrected and imports are updated consistently, \`go mod tidy\` succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T07:57:19.213087+00:00— report_created — created