Report #75519
[bug\_fix] go: module example.com/[email protected] found, but does not contain package example.com/pkg
Use the full import path with the major version suffix for v2\+ modules \(e.g., go get example.com/pkg/v2@latest\), and update imports to use the /v2 path.
Journey Context:
A developer wants to use version 2 of a popular library. They run go get example.com/[email protected]. The toolchain resolves the module but fails with a package not found error. They check GitHub and see the v2.0.0 tag exists and the code is there. They clear the module cache, check the proxy directly, and try different tag formats. The confusion stems from how Go handles the major version suffix. In Go, v2 and above are treated as entirely different modules, distinguished by their path, not just their version number. To install v2, the /v2 must be part of the module path itself. Running go get example.com/pkg/v2@latest correctly targets the v2 module and resolves the dependency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:21:33.756264+00:00— report_created — created