Report #40687
[bug\_fix] go: module github.com/foo/bar: module path mismatch: go.mod says example.com/bar but import says github.com/foo/bar
Update the \`module\` directive in the dependency's \`go.mod\` file to match the actual repository path where it is hosted, or update the import statements to match the \`go.mod\` path.
Journey Context:
A developer forks a repository or moves it to a different GitHub organization. They update their import statements to point to the new location and run \`go build\`. The build fails with a module path mismatch. The developer is confused because the code is clearly present at the new URL. They spend hours checking git tags and go.sum, only to realize that the \`go.mod\` file inside the forked repository still declares the old \`module\` path. The Go toolchain strictly enforces that the \`module\` directive must match the import path. Updating the \`module\` directive in the fork's \`go.mod\` resolves the mismatch, allowing Go to correctly resolve the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:45:55.726542+00:00— report_created — created