Skip to content

chore: modernize stdlib usage via go fix - #7

Merged
OmarAlJarrah merged 1 commit into
mainfrom
chore/go-fix-modernize
Jul 20, 2026
Merged

chore: modernize stdlib usage via go fix#7
OmarAlJarrah merged 1 commit into
mainfrom
chore/go-fix-modernize

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

Modernizes the OpenAPI compiler and validate pass to use Go 1.23 standard-library
idioms, as surfaced by go fix. No functional change — every rewrite is a
one-to-one, behavior-preserving substitution:

  • maps.Collect / maps.Copy replace manual map-building and map-copy loops
  • slices.Contains / slices.ContainsFunc / slices.Sort replace hand-rolled
    membership and sort loops
  • strings.SplitSeq replaces strings.Split where the slice was only iterated
  • integer for range N replaces for i := 0; i < N; i++ counters in tests

Net −17 lines across 9 files, with the loops collapsing to clearer intent-revealing
calls.

Test plan

  • go build ./..., go vet ./... — clean
  • go test ./... — all packages pass
  • gofmt -l — clean on tracked source
  • golangci-lint run ./compilers/... ./pass/... — 0 issues

Adopt Go 1.23 stdlib idioms across the OpenAPI compiler and validate
pass: maps.Collect/maps.Copy, slices.Contains/ContainsFunc/Sort,
strings.SplitSeq, and integer range-over-int loops. Pure
behavior-preserving cleanup with no functional change.
@OmarAlJarrah
OmarAlJarrah merged commit 18896e2 into mainJul 20, 2026
1 check passed
@OmarAlJarrah
OmarAlJarrah deleted the chore/go-fix-modernize branch July 20, 2026 17:21
Sign up for freeto 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

@OmarAlJarrah