Report #61855
[bug\_fix] module github.com/user/old-repo declares its path as github.com/user/new-repo: see go.mod
Update the import paths in your code to match the new module path declared in the dependency's go.mod, then run go mod tidy.
Journey Context:
A developer adds a dependency using go get github.com/user/old-repo. The build fails with a path mismatch error. They assume it's a caching issue and delete go.sum or clear the module cache, but the error persists. They inspect the downloaded module and realize the author renamed the repository and updated the module directive in go.mod to github.com/user/new-repo, but didn't delete the old repository or left a redirect. The Go toolchain strictly enforces that the module path in go.mod must match the path used to fetch it. The fix works because updating the import statements to the new path aligns the code with the module's declared identity, allowing the Go compiler to resolve the package correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:18:47.715465+00:00— report_created — created