Re: [go-nuts] GO generics - function implementation

2023-02-09 Thread 'Axel Wagner' via golang-nuts
These look like homework assignments. You should be aware that if that's the case, you are essentially throwing away the money you are spending on your education by refusing to learn what it's trying to teach - that is, you are paying for a product that you don't want. That being said (who am I to

[go-nuts] GO generics - function implementation

2023-02-09 Thread Stanimir Stankov
Need help! a function that allows you to group the elements of a slice based on a passed function that returns a key for each element of the slice func Partition[S any, K comparable](slice []S, fn func(S) K) map[K][]S { } a function that allows you to select elements from a slice based on a giv