mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 19:41:21 +02:00
multi: add lnutils
to host fundamental utility functions
We also move the `fn/stream.go` into the package `lnutils`. Eventually we will put all the [utility functions](https://github.com/lightninglabs/taro/tree/main/chanutils) into this package.
This commit is contained in:
13
fn/stream.go
13
fn/stream.go
@@ -1,13 +0,0 @@
|
||||
package fn
|
||||
|
||||
// Map takes an input slice, and applies the function f to each element,
|
||||
// yielding a new slice.
|
||||
func Map[T1, T2 any](s []T1, f func(T1) T2) []T2 {
|
||||
r := make([]T2, len(s))
|
||||
|
||||
for i, v := range s {
|
||||
r[i] = f(v)
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
Reference in New Issue
Block a user