Skip to content

Migrate Go v2 S3 examples from deprecated feature/s3/manager to featu…#7875

Draft
brmur wants to merge 17 commits intoawsdocs:mainfrom
brmur:update_go_examples
Draft

Migrate Go v2 S3 examples from deprecated feature/s3/manager to featu…#7875
brmur wants to merge 17 commits intoawsdocs:mainfrom
brmur:update_go_examples

Conversation

@brmur
Copy link
Copy Markdown
Collaborator

@brmur brmur commented Apr 29, 2026

…re/s3/transfermanager

The feature/s3/manager package was deprecated in February 2026 and replaced by feature/s3/transfermanager. This commit migrates all Go SDK v2 examples to use the new package.

Key changes:

  • Replace manager.NewUploader/NewDownloader with transfermanager.New (unified client)
  • Replace uploader.Upload with tmClient.UploadObject (new UploadObjectInput type)
  • Replace downloader.Download with tmClient.DownloadObject (new DownloadObjectInput type)
  • Replace manager.NewWriteAtBuffer with tmtypes.NewWriteAtBuffer
  • Configure PartSize via Options.PartSizeBytes on the client
  • Use transfermanager/types.ChecksumAlgorithmSha256 for checksum config
  • Update go.mod dependencies from feature/s3/manager to feature/s3/transfermanager

Files modified:

  • gov2/s3/actions/bucket_basics.go (UploadLargeObject, DownloadLargeObject)
  • gov2/s3/go.mod
  • gov2/workflows/s3_object_lock/actions/s3_actions.go (S3Actions struct, UploadObject)
  • gov2/workflows/s3_object_lock/actions/s3_actions_test.go
  • gov2/workflows/s3_object_lock/workflows/s3_object_lock.go
  • gov2/workflows/s3_object_lock/go.mod

This pull request...


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions Bot added the Go-v2 This issue relates to the AWS SDK for Go V2 label Apr 29, 2026
@brmur brmur marked this pull request as draft April 29, 2026 13:59
@brmur brmur added the Basics A basic code example showing the core actions for a particular service. label Apr 29, 2026
@github-actions github-actions Bot added Tools This issue relates to a custom tooling to streamline development tasks GitHub settings This affects GitHub settings labels Apr 29, 2026
brmur added 15 commits April 29, 2026 18:11
…re/s3/transfermanager

The feature/s3/manager package was deprecated in February 2026 and replaced
by feature/s3/transfermanager. This commit migrates all Go SDK v2 examples
to use the new package.

Key changes:
- Replace manager.NewUploader/NewDownloader with transfermanager.New (unified client)
- Replace uploader.Upload with tmClient.UploadObject (new UploadObjectInput type)
- Replace downloader.Download with tmClient.DownloadObject (new DownloadObjectInput type)
- Replace manager.NewWriteAtBuffer with tmtypes.NewWriteAtBuffer
- Configure PartSize via Options.PartSizeBytes on the client
- Use transfermanager/types.ChecksumAlgorithmSha256 for checksum config
- Update go.mod dependencies from feature/s3/manager to feature/s3/transfermanager

Files modified:
- gov2/s3/actions/bucket_basics.go (UploadLargeObject, DownloadLargeObject)
- gov2/s3/go.mod
- gov2/workflows/s3_object_lock/actions/s3_actions.go (S3Actions struct, UploadObject)
- gov2/workflows/s3_object_lock/actions/s3_actions_test.go
- gov2/workflows/s3_object_lock/workflows/s3_object_lock.go
- gov2/workflows/s3_object_lock/go.mod
The CI golangci-lint is built with Go 1.23 and cannot lint modules
targeting Go 1.24. Downgrade the go directive to unblock CI.
Fix golangci-lint CI failures across all gov2 modules, not just the
ones modified for the transfermanager migration.
The go 1.23 downgrade was incorrect — the modules need 1.24. The CI
golangci-lint version needs to be updated separately. Running go mod tidy
to resolve dependency issues instead.
The CI golangci-lint is built with Go 1.23 and cannot process modules
targeting Go 1.24. Keep all gov2 go.mod files at go 1.23 until the CI
toolchain is upgraded.
The go.sum files still referenced the old feature/s3/manager dependency
but the go.mod now requires feature/s3/transfermanager. Removing them
so CI can regenerate with correct checksums via go mod tidy.
Resolves 'no go files to analyze' CI errors by providing correct
go.sum checksums for the new feature/s3/transfermanager dependency.
go mod tidy auto-upgraded to go 1.24 and added toolchain go1.24.2,
which breaks CI golangci-lint (built with Go 1.23). Pin back to 1.23
and remove the toolchain directive.
Ran go mod tidy on bedrock-runtime, cloudfront, iam, lambda, and
user_pools_and_lambda_triggers to resolve stale go.sum entries, then
removed the toolchain go1.24.2 lines that go mod tidy auto-added.
This fixes the 'no go files to analyze' golangci-lint errors.
aws-sdk-go-v2@v1.41.5 requires go 1.24 in its own go.mod, so
downgrading to go 1.23 is not possible. The CI golangci-lint must be
upgraded to a version built with Go 1.24+.
The go.mod files require go 1.24 (mandated by aws-sdk-go-v2@v1.41.5).
Update the lint workflow to use Go 1.24 and golangci-lint v1.64.8
(built with Go 1.24 support). Also bump setup-go action to v5.
@brmur brmur force-pushed the update_go_examples branch from cec652e to 6cf7eaa Compare April 29, 2026 17:11
brmur added 2 commits April 29, 2026 18:02
…adObject)

v0.1.0 was an early release that only had PutObject. The UploadObject,
DownloadObject, and related types were added in later versions.
v0.1.18 is the latest and has the full API we need.
The newer SDK (v1.41.6) and transfermanager (v0.1.18) send additional
fields by default that the test stubs weren't expecting:

- GetObject now sends ChecksumMode: ENABLED
- CreateMultipartUpload now sends ChecksumAlgorithm: CRC32
- UploadPart now sends ChecksumAlgorithm: CRC32
- DownloadObject uses part-based downloads (PartNumber) instead of
  byte-range downloads

Updated stubs and large object test to match the new behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Basics A basic code example showing the core actions for a particular service. GitHub settings This affects GitHub settings Go-v2 This issue relates to the AWS SDK for Go V2 Tools This issue relates to a custom tooling to streamline development tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant