mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-25 23:03:38 +01:00
10 lines
159 B
Go
10 lines
159 B
Go
package array
|
|
|
|
func Map[T, V any](arr []T, fn func(T) V) []V {
|
|
result := make([]V, len(arr))
|
|
for i, t := range arr {
|
|
result[i] = fn(t)
|
|
}
|
|
return result
|
|
}
|