FILE / ScuroNeko/SNekLog
utils.go
Исходный файл и его история в репозитории.
- rename package to sneklog and move module to /v2 - replace text output flags with writer formatters - remove external color dependencies - update migration notes and coverage
11 lines
217 B
Go
11 lines
217 B
Go
package sneklog
|
|
|
|
// 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
|
|
}
|