This commit is contained in:
41666 2024-06-13 22:33:29 -04:00
commit c5cc245e25
29 changed files with 926 additions and 0 deletions

11
util/map.go Normal file
View file

@ -0,0 +1,11 @@
package util
func Map[In, Out any](inSlice []In, predicate func(In) Out) []Out {
outSlice := make([]Out, len(inSlice))
for i := range inSlice {
outSlice[i] = predicate(inSlice[i])
}
return outSlice
}