Report #14625
[bug\_fix] go: module github.com/user/forked-repo declares its path as github.com/user/original-repo: mismatch
Update the import statements in the consuming code to match the module directive declared in the dependency's go.mod, or update the module directive in the dependency if you own it and are intentionally renaming it.
Journey Context:
A developer forks a repository to fix a bug and updates their go.mod using a replace directive to point to their fork: replace github.com/user/original-repo => github.com/user/forked-repo v1.0.0. When they run go build, they get a mismatch error. They might try deleting the modcache, changing the replace version, or manually editing go.sum. The error persists because the go.mod file inside the forked repo still contains module github.com/user/original-repo. The Go toolchain strictly enforces that the import path used by the consumer must exactly match the module path declared by the producer. To fix this, the developer must either rewrite the import paths in their own code to match the fork's new module path \(if the fork changed it\), or, if the fork didn't change the go.mod module path, simply import it as the original repo and use the replace directive without changing the import paths.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:56:47.293052+00:00— report_created — created