Skip to content

fix(it.Mode): align behavior with lo.Mode and ensure consistent slice…#711

Merged
samber merged 2 commits into
samber:masterfrom
intojhanurag:fix/it-mod-example
Oct 12, 2025
Merged

fix(it.Mode): align behavior with lo.Mode and ensure consistent slice…#711
samber merged 2 commits into
samber:masterfrom
intojhanurag:fix/it-mod-example

Conversation

@intojhanurag
Copy link
Copy Markdown
Contributor

fix #709
Fixed inconsistent slice capacity between lo.Mode and it.Mode.
Reused slice memory with append(mode[:0], item) and added a test
to ensure len(result) == cap(result).

image

Comment thread it/math_test.go
@intojhanurag
Copy link
Copy Markdown
Contributor Author

Hey @samber , This is ready for review.

@samber samber merged commit 02d371c into samber:master Oct 12, 2025
1 check failed
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.

Different behavior between lo.Mode / it.Mode

2 participants