-
-
Notifications
You must be signed in to change notification settings - Fork 896
Open
Labels
Description
Suppose there are two arrays, aa
and bb
. I want to convert them into a map in the form of {a: b}
. Currently, I need to write the code like this:
aToB := lo.FromEntries(lo.Map(lo.Zip2(aa, bb), func(kv lo.Tuple2[int64, string], _ int) lo.Entry[int64, string] {
return lo.Entry[int64, string]{
Key: kv.A,
Value: kv.B,
}
}))
It would be much more convenient if there were a method that could directly convert lo.Tuple2
to lo.Entry
.