Report #84555
[bug\_fix] go: module X found, but does not contain package Y
Correct the import path in the Go source code to match the exact subdirectory path of the package within the target module.
Journey Context:
A developer wants to use the AWS SDK and runs 'go get github.com/aws/aws-sdk-go'. In their code, they write 'import "github.com/aws/aws-sdk-go/service/s3"' but accidentally typo it as 'import "github.com/aws/aws-sdk-go/service"' or they import the root module expecting it to contain everything. When they build, they get 'module found, but does not contain package'. They verify the module is in go.mod and run 'go mod download', but the error persists. The issue is that a Go module is a collection of packages, and the import path must point to a specific directory containing Go files. The root module path might not have any Go files in it, only subdirectories do. By correcting the import path to exactly match the specific package directory within the module repository, the go tool can locate the package and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:31:03.168078+00:00— report_created — created