10 lines
143 B
Go
10 lines
143 B
Go
package slog
|
|
|
|
func Map[T, R any](s []T, f func(T) R) []R {
|
|
out := make([]R, len(s))
|
|
for i, el := range s {
|
|
out[i] = f(el)
|
|
}
|
|
return out
|
|
}
|