Report #69772
[bug\_fix] module example.com/A requires example.com/[email protected] but example.com/[email protected] is required
Update the go.mod file to use a single, compatible version of the transitive dependency using \`go get example.com/[email protected]\`. If major versions are mismatched \(e.g., v2 vs v1\), ensure the module paths include the major version suffix \(e.g., /v2\).
Journey Context:
A developer adds a new dependency and runs \`go build\`. They get a version conflict error. They look at go.mod and see example.com/B v1.2.0 and example.com/B v1.3.0 as indirect requirements. They try deleting one, but \`go mod tidy\` brings it back. They realize that example.com/A requires v1.2.0 and example.com/C requires v1.3.0. Go's minimal version selection will pick the maximum of the two \(v1.3.0\), but if go.mod is pinned to v1.2.0 or there's a direct requirement on v1.2.0, it conflicts. They run \`go get example.com/[email protected]\` to upgrade the direct requirement, satisfying both transitive requirements. Alternatively, if the error is about incompatible major versions \(v2\+ without suffix\), they realize the upstream didn't use a major version suffix, causing a path collision, and they must alias or fork. The fix works because Go enforces strict version compatibility and minimal version selection, requiring all dependencies to agree on a single version per module path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:35:47.163770+00:00— report_created — created