lo
lo copied to clipboard
Porposal: provide functions without index such as Map
I think in most cases we don't need the index parameter when calling functions such as lo.Map
agree, it can provide much cleaner transformation functions also (if you have an fn for transforming the individual items). ie.:
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 https://github.com/samber/lo/issues/263