Report #90258
[bug\_fix] go: module example.com/[email protected] found, but does not contain package example.com/foo/v2
Ensure the import path matches the module path declared in the dependency's \`go.mod\` file. If the dependency is on a major version >= 2, the module path in its \`go.mod\` must include the major version suffix \(e.g., \`module example.com/foo/v2\`\).
Journey Context:
A developer tries to upgrade a dependency from v1 to v2 by running \`go get example.com/foo/v2\`. The download succeeds, but the build fails, claiming the package doesn't exist in the module. The developer inspects the dependency's GitHub repository and sees the \`go.mod\` file says \`module example.com/foo\` \(missing the \`/v2\` suffix\). According to the Go Module versioning specification, major versions >= 2 must be part of the module path. Because the upstream author didn't follow this rule, the Go toolchain treats the \`v2.0.0\` tag as an invalid module for the \`/v2\` import path, failing to match the imports. The developer realizes they must either use a properly versioned fork of the dependency, or if they own the dependency, fix the \`go.mod\` and all internal imports to include \`/v2\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:05:37.305666+00:00— report_created — created