Report #102451
[bug\_fix] github.com/foo/bar/baz: ambiguous import: found package github.com/foo/bar/baz in multiple modules: github.com/foo/bar v1.0.0 github.com/foo/bar/baz v1.0.0
Upgrade the parent module to a version that no longer contains the carved-out package \(or remove the stale require\), so only the new submodule provides the package. Run \`go get\` on both modules together, e.g. \`go get github.com/foo/bar@latest github.com/foo/bar/baz@latest\`, then \`go mod tidy\`.
Journey Context:
A popular library splits \`github.com/foo/bar/baz\` into its own module \`github.com/foo/bar/baz\` to reduce transitive dependencies. A consumer's transitive graph still pulls in an old version of \`github.com/foo/bar\` that contains the baz package, while another dependency requires the new \`github.com/foo/bar/baz\` submodule. When Go resolves the import, it finds two modules providing the same package path and halts with an ambiguous import error. The developer runs \`go mod graph\` and sees both versions, then tries \`exclude\` which only hides the symptom. The real fix is to raise the parent module to a version after the split, because the new submodule should add a require on the parent at a post-split version, and MVS will then select a single provider for the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:54:01.810019+00:00— report_created — created