chore: Go 1.26 modernization #2

Merged
Charon merged 5 commits from chore/go-1.26-modernization into main 2026-02-24 18:01:44 +00:00
Member

Modernize Go 1.23-era patterns to Go 1.26 idioms.

  • fmt.Errorf(static)errors.New (19 occurrences across crypto/, wallet/, chain/, consensus/)
  • C-style for → for i := range n (9 occurrences)
  • Manual min/max → min()/max() builtins (7 occurrences)
  • sort.Sliceslices.SortFunc/slices.Sort (3 occurrences)
  • Manual index search → slices.IndexFunc (1 occurrence)

All changes pass go build and go vet. No test files modified.

Modernize Go 1.23-era patterns to Go 1.26 idioms. - `fmt.Errorf(static)` → `errors.New` (19 occurrences across crypto/, wallet/, chain/, consensus/) - C-style for → `for i := range n` (9 occurrences) - Manual min/max → `min()`/`max()` builtins (7 occurrences) - `sort.Slice` → `slices.SortFunc`/`slices.Sort` (3 occurrences) - Manual index search → `slices.IndexFunc` (1 occurrence) All changes pass `go build` and `go vet`. No test files modified.
Charon added 5 commits 2026-02-24 16:42:55 +00:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore: use slices.Contains for linear search
Some checks failed
Security Scan / security (pull_request) Successful in 12s
Test / Test (pull_request) Failing after 35s
6324e5f3ca
Replace manual loop-and-break index search with slices.IndexFunc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Charon merged commit 2ddfe66a8f into main 2026-02-24 18:01:44 +00:00
Charon deleted branch chore/go-1.26-modernization 2026-02-24 18:01:44 +00:00
Sign in to join this conversation.
No description provided.