This repository has been archived on 2023-12-27. You can view files and clone it, but cannot push or open issues or pull requests.
ledger-tui/pkg/collections/collections.go

10 lines
146 B
Go

package collections
func Map[T any, M any](a []T, f func(T) M) []M {
n := make([]M, len(a))
for i, e := range a {
n[i] = f(e)
}
return n
}