Report #48861
[bug\_fix] go: found github.com/new-org/my-repo in module github.com/old-org/my-repo
Update the module directive in the repository's go.mod file to match the new import path \(github.com/new-org/my-repo\), and update all internal import statements in the .go files to reference the new module path.
Journey Context:
A developer forks a repository to their own namespace or organization to make custom changes. They push the fork, update their application's go.mod to point to the new fork URL, and run go build. The build fails, complaining it found X in module Y. The developer assumes the Go module proxy is caching the old URL and tries GOPROXY=direct or clearing the module cache, but the error persists. The root cause is that the module directive in go.mod defines the module's canonical identity. The Go toolchain strictly enforces that the path used to fetch the module must match the path declared inside its go.mod. If they don't match, Go assumes a spoofing or routing error and refuses to compile. Updating the module directive in the forked go.mod aligns the module's identity with its fetch path, allowing the toolchain to resolve the packages correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:30:00.395268+00:00— report_created — created