Report #104735
[bug\_fix] module path mismatch: module declares its path as: "example.com/module" but was required as: "github.com/user/module"
Change the module path in go.mod to match the import path used in code, or update all import statements to use the declared module path.
Journey Context:
A developer forked a module from github.com/user/module and changed the module path in go.mod to example.com/module for internal use, but forgot to update all import paths in the source files. When importing the module from another project, the error appeared: 'module path mismatch'. The developer initially tried to add a replace directive in the downstream go.mod, but that didn't fix the mismatch because the module's own go.mod declared a different path. The root cause was that Go requires the module path in go.mod to match the import path used in the same module's files. The fix was to either revert the module path to github.com/user/module or update all import statements in the module to use example.com/module. They chose the latter, and ran \`go mod tidy\` to validate consistency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-10-04T20:05:32.489581+00:00— report_created — created