dal/pkg/utils/common.go
Anton Nesterov d28d976b8e
[wip] dal golang
Signed-off-by: Anton Nesterov <anton@demiurg.io>
2024-08-07 21:16:40 +02:00

10 lines
143 B
Go

package utils
func Map[T, U any](ts []T, f func(T) U) []U {
us := make([]U, len(ts))
for i := range ts {
us[i] = f(ts[i])
}
return us
}