Report #26599
[bug\_fix] go: module github.com/aws/[email protected] found, but does not contain package github.com/aws/aws-sdk-go/v2/service/s3
Change the import path to match the major version of the module. If importing a v2\+ package, the module path in \`go.mod\` and the import path must both include the \`/v2\` suffix. Run \`go get github.com/aws/aws-sdk-go/v2@latest\` to fix the module requirement.
Journey Context:
A developer is migrating an application from AWS SDK v1 to v2. They update their import statements from \`github.com/aws/aws-sdk-go/service/s3\` to \`github.com/aws/aws-sdk-go/v2/service/s3\`. They run \`go build\` and hit the 'found, but does not contain package' error. Puzzled, they check GitHub and confirm the \`v2/service/s3\` directory absolutely exists. They try deleting the module cache, but it doesn't help. The rabbit hole leads them to Go's Semantic Import Versioning spec. Because the SDK is on major version 2, the module path itself must change to include the \`/v2\` suffix. The developer's \`go.mod\` still required \`github.com/aws/aws-sdk-go v1.40.0\`. The Go toolchain downloaded v1.40.0 and looked for a \`/v2/service/s3\` directory inside it, which naturally didn't exist. The fix is to run \`go get github.com/aws/aws-sdk-go/v2@latest\`, which correctly updates the \`go.mod\` requirement to \`github.com/aws/aws-sdk-go/v2\` and resolves the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:02:57.772185+00:00— report_created — created