Report #11670
[bug\_fix] ambiguous import: found package in multiple modules: \(\), \(\)
Find the \`require\` directives in \`go.mod\` that provide the same package and remove the duplicate, or add a \`replace\` directive to point to a single module.
Journey Context:
A developer runs go build and encounters an 'ambiguous import' error, meaning the same import path is provided by two different modules in the go.mod file. This often happens when a project is forked, or when a package is accidentally moved between modules in a monorepo. The developer tries deleting the go.sum or running go get, but the ambiguity persists. They inspect go.mod and realize they have both 'require github.com/original/pkg' and 'require github.com/forked/pkg', and both modules declare the same internal import path. The fix is to remove one of the conflicting require directives, or use a replace directive to redirect the original module to the forked one, ensuring only one module provides the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:54:10.181806+00:00— report_created — created