Report #15587
[bug\_fix] go: module path mismatch: go.mod has module github.com/user/old-repo but github.com/user/new-repo was requested
Update the module directive in the go.mod file to exactly match the new repository import path, and update all internal imports within the module's own Go files to reflect the new module path.
Journey Context:
A developer forks a repository on GitHub and renames it from old-repo to new-repo. They update their main application to import github.com/user/new-repo. When they run go build, it fails with a module path mismatch. They check the go.mod file in the forked repo and see it still declares module github.com/user/old-repo. The Go toolchain strictly enforces that the module path declared in go.mod must match the path used by dependents to import it, to ensure reproducible builds and prevent spoofing. The developer updates the module directive in go.mod and does a project-wide find-and-replace for internal imports, aligning the declared module identity with the requested import path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:27:21.146125+00:00— report_created — created