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 -1
View File
@@ -349,7 +349,7 @@ func ensureExposeMetaHeaders(ctx *fiber.Ctx) {
lowerExisting := map[string]struct{}{}
if existing != "" {
for _, part := range strings.Split(existing, ",") {
for part := range strings.SplitSeq(existing, ",") {
p := strings.ToLower(strings.TrimSpace(part))
if p != "" {
lowerExisting[p] = struct{}{}
+1 -1
View File
@@ -29,7 +29,7 @@ func ensureExposeETag(ctx *fiber.Ctx) {
}
lowerExisting := map[string]struct{}{}
for _, part := range strings.Split(existing, ",") {
for part := range strings.SplitSeq(existing, ",") {
p := strings.ToLower(strings.TrimSpace(part))
if p != "" {
lowerExisting[p] = struct{}{}
+6 -6
View File
@@ -401,8 +401,8 @@ func ParseObjectAttributes(ctx *fiber.Ctx) (map[s3response.ObjectAttributes]stru
if len(value) == 0 {
break
}
oattrs := strings.Split(string(value), ",")
for _, a := range oattrs {
oattrs := strings.SplitSeq(string(value), ",")
for a := range oattrs {
attr := s3response.ObjectAttributes(a)
if !attr.IsValid() {
debuglogger.Logf("invalid object attribute: %v\n", attr)
@@ -500,16 +500,16 @@ type ChecksumValues map[types.ChecksumAlgorithm]string
// e.g.
// "x-amz-checksum-crc64nvme, x-amz-checksum-sha1"
func (cv ChecksumValues) Headers() string {
result := ""
var result strings.Builder
isFirst := false
for key := range cv {
if !isFirst {
result += ", "
result.WriteString(", ")
}
result += fmt.Sprintf("x-amz-checksum-%v", strings.ToLower(string(key)))
result.WriteString(fmt.Sprintf("x-amz-checksum-%v", strings.ToLower(string(key))))
}
return result
return result.String()
}
// ParseCalculatedChecksumHeaders parses and validates x-amz-checksum-x header keys
+1 -1
View File
@@ -992,7 +992,7 @@ func TestParseTagging(t *testing.T) {
},
}
for i := 0; i < lgth; i++ {
for range lgth {
res.TagSet.Tags = append(res.TagSet.Tags, s3response.Tag{
Key: genRandStr(10),
Value: genRandStr(20),