Skip to content

stdlib: replace hand-rolled slices/strings logic with stdlib calls - #385

Merged
anish749 merged 1 commit into
mainfrom
slices-strings-stdlib-fixes
Jul 11, 2026
Merged

stdlib: replace hand-rolled slices/strings logic with stdlib calls#385
anish749 merged 1 commit into
mainfrom
slices-strings-stdlib-fixes

Conversation

@anish749

Copy link
Copy Markdown
Owner

Summary

  • Replaces manual index/contains/dedupe/sort/reverse/clone loops with slices.*, and manual prefix/suffix/split slicing with strings.Cut/CutPrefix/CutSuffix, across 48 files (80 call sites).
  • Findings came from a full-repo audit for hand-rolled stdlib reimplementations; each was independently adversarially verified (behavioral equivalence + validity) before being applied here. Scoped to slices/strings only — other categories (min/max, cmp, errors, encoding, etc.) are left for a separate PR.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...
  • gofmt -l clean on all touched files

🤖 Generated with Claude Code

Swaps manual index/contains/dedupe/sort/reverse/clone loops for slices.*,
and manual prefix/suffix/split slicing for strings.Cut/CutPrefix/CutSuffix,
across 48 files. Behavior-preserving; findings were adversarially verified
(equivalence + validity) before applying.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@anish749
anish749 merged commit 1055b16 into main Jul 11, 2026
1 check passed
@anish749
anish749 deleted the slices-strings-stdlib-fixes branch July 11, 2026 12:48
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