Report #62439
[bug\_fix] module github.com/user/project declares its path as github.com/original/project: mismatch
Update the module directive in the forked repository's go.mod file to match the new repository path, or use a replace directive in the consuming project's go.mod to point the original import path to the new fork URL.
Journey Context:
A developer forks an open-source repository to fix a bug, pushes it to their own GitHub namespace \(github.com/user/project\), and updates their application's import statements to point to the new fork. They run go mod tidy, but the toolchain throws a path mismatch error. The developer initially suspects a caching issue and runs go clean -modcache, but the error persists. They eventually realize that the go.mod file in the forked repo still contains the original module path \(module github.com/original/project\). The Go toolchain strictly enforces that the module directive must match the import path. Because the code is imported as github.com/user/project but declares itself as github.com/original/project, the build fails. They update the module directive in the fork, or alternatively, use a replace directive in the main application to map the old path to the new fork without modifying the fork's go.mod.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:17:19.666965+00:00— report_created — created