Report #11667
[bug\_fix] module @ found, but does not contain package
Check if the package path appended to the module path actually exists in the repository at the requested version tag. Often, the package was moved or removed in a newer version, or the version tag doesn't exist. Target a specific branch or correct tag where the package exists.
Journey Context:
A developer imports a sub-package like github.com/someorg/somemod/v2/internal/sub. They run go mod tidy and get an error that the module is found, but the package is missing. They check GitHub and see the package exists on the main branch. The rabbit hole begins: they try go get github.com/someorg/somemod@latest, but it still fails. The root cause is that Go modules use semantic versioning tags. The @latest might resolve to a tagged release \(e.g., v2.0.0\) where the internal/sub directory was removed or not yet merged, even though it exists on the default branch. The fix is to explicitly target the branch \(e.g., @main\) or find the correct tag where the package exists, or realize the package was deprecated and find an alternative.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:54:09.570884+00:00— report_created — created