Report #102946
[bug\_fix] module path mismatch: go.mod declares module "github.com/oldname/app", but imported as "github.com/newname/app"
Update the module directive in go.mod to match the canonical repository path, then run \`go mod tidy\` and \`go build ./...\` to refresh the module graph. If the repository was renamed, also update import paths in source files and consider using \`gofmt -r\` or a rewrite tool.
Journey Context:
A team forked and renamed a repo from \`github.com/acme/legacy\` to \`github.com/acme/v2\`, updated the directory and git remote, but forgot to change the \`module\` line in \`go.mod\`. A teammate cloned the new repo and ran \`go test ./...\`; Go printed \`go: github.com/acme/v2/pkg/utils: module github.com/acme/v2@latest found \(v0.0.0\), but does not contain package github.com/acme/v2/pkg/utils\`. They first suspected a caching issue and ran \`go clean -modcache\`, then tried \`GOPROXY=direct\`, but the error persisted. After inspecting \`go.mod\`, they noticed the old module path. Once they aligned the module directive with the new repository path and ran \`go mod tidy\`, the resolver could match local packages correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:45:37.490035+00:00— report_created — created