Report #97207
[bug\_fix] go: module declares its path as: github.com/old-org/bar, but was required as: github.com/new-org/bar \(module path mismatch\)
Update the module directive in the dependency's go.mod so it matches the canonical import path consumers use, or update the consumer's imports/require/replace directives to match the declared path, then run go mod tidy. If the repo moved, change the 'module' line, not just import statements.
Journey Context:
We moved a library from github.com/old-org/bar to github.com/new-org/bar and updated all import paths in the main repo, but local builds still worked because a replace directive pointed at the checked-out directory. In CI, with no replace and a fresh module cache, go build failed with a module path mismatch. The error message pointed at the dependency's go.mod, which still said 'module github.com/old-org/bar'. After tracing with 'go list -m all', we realized Go identifies a module by the path declared in its go.mod, not by the URL it was fetched from. Updating the dependency's module directive to github.com/new-org/bar and bumping the required version made the mismatch disappear.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:43:38.209245+00:00— report_created — created