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:
3 files changed
+7
-3
No files matched your search
@@ -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