10 lines
130 B
Go
10 lines
130 B
Go
|
package utils
|
||
|
|
||
|
func Map[T any](in []T, fn func(T) T) []T {
|
||
|
out := in
|
||
|
for i := range in {
|
||
|
out[i] = fn(out[i])
|
||
|
}
|
||
|
return out
|
||
|
}
|