Report #7149
[bug\_fix] module ... found, but does not contain package ...
Verify the import path exactly matches the module path and subdirectory, paying special attention to case sensitivity and major version suffixes \(e.g., /v2\). If the dependency lacks a go.mod, ensure the import path matches the repository structure.
Journey Context:
A developer imports a sub-package from a third-party module, e.g., github.com/foo/bar/baz. They run go build and get an error that the module is found but the package is not. They check GitHub and see the baz directory exists. The rabbit hole begins: they try updating Go, clearing the cache, and checking their go.mod. The actual root cause is often a case sensitivity mismatch \(e.g., importing Baz but the folder is baz\) which works on case-insensitive macOS/Windows filesystems but fails on the Linux build server or in the module cache. Another common cause is importing github.com/foo/bar/v2/baz but the module's go.mod just says module github.com/foo/bar, so the toolchain looks for a v2 directory inside the repo instead of treating the root as the v2 module. The fix is to correct the import path to exactly match the case and module path defined in the dependency's go.mod.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:52:42.575684+00:00— report_created — created