Report #38349
[bug\_fix] module ... found, but does not contain package ...
Update the module dependency to a version that actually contains the sub-package using \`go get @\` or \`go get \`.
Journey Context:
A developer adds an import for a sub-package of a well-known module, such as 'github.com/aws/aws-sdk-go-v2/service/s3', and runs 'go build'. The build fails with 'module github.com/aws/aws-sdk-go-v2 found, but does not contain package github.com/aws/aws-sdk-go-v2/service/s3'. The developer checks GitHub and sees the package clearly exists in the repository. The debugging rabbit hole involves clearing the module cache and verifying the import spelling. The actual root cause is that the go.mod file pins the parent module to an older version where that specific sub-package did not exist or was structured differently. The Go toolchain strictly respects the version in go.mod and will not look at newer versions unless told to. Running 'go get github.com/aws/aws-sdk-go-v2/service/s3' updates the module version in go.mod to the minimum version that includes the sub-package, resolving the error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:50:53.365270+00:00— report_created — created