Report #79752
[bug\_fix] go: module found, but does not contain package
Correct the import path in the Go source code to match the actual directory structure within the target module, or verify the package exists in the specified version. The root cause is that the Go toolchain successfully downloaded the module, but the import path does not correspond to any directory inside that module's root, often because the package is in a subdirectory or requires a major version suffix.
Journey Context:
A developer adds a dependency using \`go get example.com/mylib@latest\` and imports it as \`example.com/mylib\`. The build fails with this error. They run \`go mod tidy\`, clear the module cache with \`go clean -modcache\`, and even delete \`go.sum\`, but the error persists. They inspect the module's source code on GitHub and realize the main functionality is located in a subdirectory, e.g., \`example.com/mylib/pkg/core\`, or the module path requires a major version suffix like \`example.com/mylib/v2\`. They update the import statement in their code to match the actual package path, and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:27:39.855255+00:00— report_created — created