Skip to content

refactor: apply the Go 1.27 go fix modernizers - #112

Merged
tas50 merged 1 commit into
mainfrom
refactor/go-fix-modernizers
Oct 13, 2026
Merged

tas50 merged 1 commit into
mainfrom
refactor/go-fix-modernizers

Conversation

@tas50

@tas50 tas50 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Runs go fix ./... (Go 1.27) over both modules and keeps everything it suggests. All are behavior-preserving rewrites to current idiom:

Rewrite Where
errors.As(err, &v) → errors.AsType[T](err) transport.go (isRetriable), acls_grant_test.go
strings.IndexByte + slice → strings.Cut transport.go (stripping the query from the signing path)
range over strings.Split → strings.SplitSeq chefignore.go (no intermediate slice)
header copy loop → maps.Copy transport.go, integration/suite/raw.go
atomic.AddInt64(&n) → atomic.Int64 cookbooks_test.go, transport_test.go
if/else clamp → min search_test.go

No public API change.

Test plan

  • go test ./... -race -count=2 clean
  • cd integration && go test ./... passes (HTTP and TLS targets)
  • golangci-lint run ./... clean in both modules
  • Read every production-code hunk: the signing path, header copy and retry classification are unchanged

Mechanical rewrites from go fix on 1.27, behaviour unchanged:
errors.AsType for errors.As, strings.Cut for IndexByte slicing,
strings.SplitSeq for ranging over Split, maps.Copy for header copy
loops, atomic.Int32/Int64 types in tests, and min in a test helper.

Signed-off-by: Tim Smith <tsmith84@proton.me>
@tas50
tas50 merged commit 35ff1b3 into main Oct 13, 2026
6 checks passed
@tas50
tas50 deleted the refactor/go-fix-modernizers branch October 13, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant