Report #40130
[bug\_fix] go: module github.com/foo/[email protected] found, but does not contain package github.com/foo/bar/baz
Update the module dependency to a version that actually contains the desired package \(e.g., go get github.com/foo/bar/baz@latest\), or remove the import if the package was deprecated.
Journey Context:
A developer tries to use a sub-package of a popular library and runs go build, only to be told the package does not exist within the module. They check the library's GitHub repository and clearly see the baz directory exists. The rabbit hole begins: they clear their module cache, check for typos, and verify their GOPATH. The breakthrough comes when they realize the go.mod file in their project is pinned to an older version of the library \(e.g., v1.0.0\) that predates the creation of the baz package. The Go tooling resolves packages based on the version specified in go.mod, completely ignoring the latest commits on the default branch. The fix is to update the dependency to a version that includes the sub-package using go get github.com/foo/bar/baz@latest.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:49:45.255799+00:00— report_created — created