Report #13854
[bug\_fix] module ... found, but does not contain package ...
Update the required module version in go.mod to a version that actually contains the sub-package, or correct the import path typo.
Journey Context:
A developer adds an import for a specific sub-package of a library, e.g., github.com/lib/v2/pkg/sub. They run go mod tidy and get an error that the package doesn't exist in the module. They check GitHub and clearly see the sub directory exists. The rabbit hole: they inspect their go.mod and realize they are requiring an older version of the module \(e.g., v2.0.0\) where the sub-package hadn't been created yet. Because go mod tidy resolves based on the minimum version in go.mod, it looks at the v2.0.0 tag and fails. The fix is to explicitly upgrade the dependency using go get github.com/lib/v2/pkg/sub@latest to pull in the version where the package was introduced.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:54:44.896360+00:00— report_created — created