Report #16382
[bug\_fix] go: module ... found, but does not contain package ...
Correct the import path to match the actual package structure within the module. Often, this means removing an erroneous subdirectory from the import path \(using the module root\) or checking the repository's source tree for the correct subpath.
Journey Context:
A developer tries to use a large library and adds \`import github.com/foo/bar/v2/client\` to their code. They run \`go get github.com/foo/bar/v2\` and \`go build\` fails, stating the module was found but doesn't contain the package \`client\`. They check \`go.sum\` and see the module downloaded. The debugging rabbit hole involves clearing the module cache and trying different \`go get\` URLs. The root cause is that a Go module is a collection of packages, and the import path must exactly match the directory structure inside the module. If the \`client\` directory doesn't exist in the v2 repository, or the package code is at the module root, the import fails. The fix works because aligning the import path with the physical directory structure in the repository allows the Go toolchain to locate the package sources.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:28:28.174765+00:00— report_created — created