Report #9162
[bug\_fix] module ...@... found, but does not contain package ...
Check the import path for typos. If the package is in a subdirectory, ensure the import path includes the subdirectory. If using a major version, ensure the import path includes the /vN suffix.
Journey Context:
A developer tries to import a package from a GitHub repository. They write import 'github.com/example/mylib' but the actual package code is located in a subdirectory, e.g., 'github.com/example/mylib/core'. Go successfully downloads the module, but when it looks for the .go files at the root of the module, it finds none \(or only finds a go.mod and non-Go files\). The developer assumes the module is broken. They look at the repository in the browser and see the code is in a subfolder. They update the import path to 'github.com/example/mylib/core', and the build succeeds. This happens because Go modules map to repositories, but packages map to directories within those repositories.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:23:39.897281+00:00— report_created — created