Report #92480
[bug\_fix] go: module github.com/pkg/errors requires github.com/aws/[email protected] but github.com/aws/[email protected] is required
Ensure major version increments \(v2\+\) use a major version suffix in the module path \(e.g., /v2\), and update import statements accordingly. If an upstream dependency failed to append the suffix, it must be fixed upstream or forked. Root cause: Go's Semantic Import Versioning rule dictates that major versions > 1 must change the module path. Without the suffix, Go treats v1 and v2 as the same module, causing an unresolvable version conflict.
Journey Context:
A developer adds a new library to their project and runs \`go mod tidy\`. The command fails with a dependency version conflict, stating that v1.0.0 and v2.0.0 of the same module are required. The developer tries to force the version using \`go get github.com/[email protected]\`, but the conflict persists. They examine the dependency graph using \`go mod graph\` and notice that one dependency imports github.com/pkg while another imports github.com/pkg/v2. However, the go.mod of the v2 package incorrectly declares its module path as github.com/pkg without the /v2 suffix. This violates Go's Semantic Import Versioning spec, making the two versions mutually exclusive to the Go toolchain. The developer realizes they cannot fix this locally without modifying the upstream's go.mod to include the /v2 suffix, so they submit a PR to the upstream project and use a fork in the meantime.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:49:10.061922+00:00— report_created — created