Add GroupBy function
aswinkarthik opened this issue · 1 comments
aswinkarthik commented
API
john := Person{name: "John", age: 25}
doe := Person{name: "Doe", age: 30}
wick := Person{name: "Wick", age: 25}
input := []Person{
john,
doe,
wick,
}
var output map[int][]Person
godash.GroupBy(input, &output, func(person Person) int {
return person.age
})
// output is
// { 25: [john, wick], 30: [doe] }
pearl2201 commented
I will try to add this.