Report #79934
[bug\_fix] go: module path mismatch: go.mod says example.com/old but import says example.com/new
Update the module directive in the go.mod file to match the new repository path, and update all internal import paths within the module.
Journey Context:
A developer renames their GitHub repository from old-app to new-app and updates all their Go import statements accordingly. When they push the tag, consumers trying to go get the module hit a module path mismatch error. The developer searches their codebase and can't find any references to old-app in the .go files. After much frustration, they inspect the go.mod file and realize the module directive still declares example.com/old-app. The fix works because the module directive defines the module's identity and import path prefix; if it doesn't match how consumers import it, the Go toolchain rejects it to prevent ambiguous module identities and broken dependency graphs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:46:35.584847+00:00— report_created — created