Report #12607
[bug\_fix] go: module ... found, but does not contain package ...
Correct the import path to match the actual directory structure within the target repository, or update the dependency to a version where the package exists.
Journey Context:
A developer adds \`github.com/foo/bar/v2/pkg/baz\` to their imports and runs \`go mod tidy\`. The toolchain downloads the module \`github.com/foo/bar/v2\` but fails, stating the module does not contain the package. The developer checks go.sum and tries clearing the module cache, thinking the download was corrupted. They then visit the repository on GitHub and realize the \`pkg/baz\` directory doesn't exist in the v2 branch; the package was moved to the root or renamed during the major version refactor. The Go module system strictly maps import paths to repository directory structures. Since the subdirectory is missing, the package cannot be found. The fix is to inspect the target repository's structure, find the correct path for the desired package \(e.g., \`github.com/foo/bar/v2/baz\`\), and update the import statement to match the actual directory layout.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:25:43.398372+00:00— report_created — created