Open peterstace opened 11 months ago
I've purposefully not used generics for a long time internally because I didn't want to bump the required go version to 1.18 (it's currently go 1.17).
That's quite a few versions ago now, so it should be fine to bump this to go 1.18 and start using generics internally.
In particular, having a mapSlice[T, U any](s []T, func(T) U) []U helper would clean up a lot of repeated boilerplate.
mapSlice[T, U any](s []T, func(T) U) []U
I've purposefully not used generics for a long time internally because I didn't want to bump the required go version to 1.18 (it's currently go 1.17).
That's quite a few versions ago now, so it should be fine to bump this to go 1.18 and start using generics internally.
In particular, having a
mapSlice[T, U any](s []T, func(T) U) []U
helper would clean up a lot of repeated boilerplate.