Report #83467
[bug\_fix] module ... found, but does not contain package ...
Update the required version of the module in go.mod to a version that includes the sub-package, or correct the import path typo. Run \`go get @latest\` to fetch the newest version.
Journey Context:
A developer adds an import for a sub-package \(e.g., github.com/foo/bar/baz\) and runs go build. The build fails, claiming the module is found but the package is missing. The developer checks the source repository on GitHub and clearly sees the baz directory exists. Confused, they delete their go.sum, clear the module cache with go clean -modcache, and try again, but the error persists. The rabbit hole leads them to suspect a broken proxy or a weird caching bug. The actual root cause is that go.mod requires github.com/foo/bar v1.0.0, but the baz package was only added in v1.1.0. The Go toolchain resolves the module version from go.mod first, downloads v1.0.0, and looks for the package there. Since it doesn't exist in that version, it fails. Updating the dependency version resolves the mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:41:25.674270+00:00— report_created — created