Report #43546
[bug\_fix] go: module example.com/m requires github.com/[email protected] but github.com/[email protected] is required
Update the requiring module's dependency in go.mod to the higher version using go get github.com/[email protected], or if the lower version is strictly necessary, add a replace directive to force the version, understanding the risks.
Journey Context:
A developer adds a new library dependency to their project. Upon running go build, they get a version conflict error. They check go.mod and see v1.1.0, but another dependency requires v1.0.0. They try deleting go.sum and running go mod tidy, but the error persists. They run go mod graph and trace the dependency tree, finding that an older library they use strictly depends on v1.0.0. Go's Minimum Version Selection \(MVS\) normally resolves this by picking v1.1.0 \(the maximum of the minimums\), but if the go.mod of the main module was manually edited or a replace directive was already present pointing to the lower version, it causes a conflict. The fix works because explicitly updating the dependency aligns the main module's go.mod with MVS, allowing the build to proceed with the highest required minimum version.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:33:56.430227+00:00— report_created — created