FILE / ScuroNeko/SNekLog

utils.go

Исходный файл и его история в репозитории.
FILE v1.2.0
Files
SNekLog/utils.go
T

11 lines
214 B
Go

package slog
// Map applies f to each element of s and returns the resulting slice.
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
}