chore: run go modernize tool

This is a fixup of the codebase using:
go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -fix ./...

This has no bahvior changes, and only updates safe changes for
modern go features.
This commit is contained in:
Ben McClelland
2026-03-10 09:47:37 -07:00
parent 6e13be6984
commit 97cc6bf23b
29 changed files with 67 additions and 88 deletions
+1 -6
View File
@@ -22,12 +22,7 @@ func (c *PayloadChunked) getChunkedPayloadContentLength(additionalChunkHeaderSiz
var sizeIdx int64
var contentLength int64
for sizeIdx = 0; sizeIdx < payloadSize; sizeIdx += c.chunkSize {
var endIdx int64
if sizeIdx+c.chunkSize < payloadSize {
endIdx = sizeIdx + c.chunkSize
} else {
endIdx = payloadSize
}
endIdx := min(sizeIdx+c.chunkSize, payloadSize)
hexSize := fmt.Sprintf("%x", endIdx-sizeIdx)
contentLength += int64(len(hexSize)) + additionalChunkHeaderSize + (endIdx - sizeIdx) + 2
}
@@ -56,8 +56,8 @@ func NewPutBucketCORSCommand(command *S3Command, ruleStrings []string) (*S3Comma
func assembleCORSRule(ruleString string) (*CORSRule, error) {
corsRule := &CORSRule{}
ruleComponents := strings.Split(ruleString, ";")
for _, component := range ruleComponents {
ruleComponents := strings.SplitSeq(ruleString, ";")
for component := range ruleComponents {
componentSegments := strings.Split(component, "=")
switch componentSegments[0] {
case AllowedMethods: