-
-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porposal: provide functions without index such as Map #402
Comments
agree, it can provide much cleaner transformation functions also (if you have an fn for transforming the individual items). func transformList(ns []int) []string {
// return lo.Map(ns, transform)
return lo.Map(ns, func(item int, _ int) string {
return transform(item)
}
}
func transform(n int) string {
return fmt.Sprintf("%d", n)
} |
seems to be duplicate of #263 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think in most cases we don't need the index parameter when calling functions such as lo.Map
The text was updated successfully, but these errors were encountered: