Skip to content

Conversation

@mtlynch
Copy link
Owner

@mtlynch mtlynch commented Jan 23, 2026

Replace manual slice operations with standard library slices package:

  • Use slices.Contains() instead of manual isWordInSlice loop
  • Use slices.SortFunc() with cmp.Compare instead of sort.Slice
  • Use slices.IndexFunc() for finding elements by predicate

These functions were added in Go 1.21 and provide cleaner, more readable code with better type safety.

Replace manual slice operations with standard library slices package:

- Use slices.Contains() instead of manual isWordInSlice loop
- Use slices.SortFunc() with time.Time.Compare instead of sort.Slice

These functions were added in Go 1.21 and provide cleaner, more
readable code with better type safety.

Co-authored-by: Shelley <shelley@exe.dev>
@mtlynch mtlynch force-pushed the modernize/slices-package branch from 9556a49 to be3c65d Compare January 23, 2026 00:52
@mtlynch mtlynch enabled auto-merge (squash) January 23, 2026 00:53
@mtlynch mtlynch merged commit 533200d into master Jan 23, 2026
9 checks passed
@mtlynch mtlynch deleted the modernize/slices-package branch January 23, 2026 00:55
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants