You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually, we use one to one mapper: a key to a value of map, but we also like to series a dozen of values in a specific way sometimes, the result is a bunch of values mappers to the same key, that will like be:
// key is a specific regxkv:=map[string]string{"key1-1": "a", "key1-2": "b", "key2-1": "c", "key2-2": "d"}
or
// inner is a slicekv:=map[string][]string{
"key1": {"a", "b"},
"key2": {"c", "d"},
}
// or inner is a mapkv:=map[string]map[string]struct{}{
"key1": {
"a": struct{}{},
"b": struct{}{},
},
"key2": {
"c": struct{}{},
"d": struct{}{},
},
}
url.Values is so like this and supply some helpful method like Add \ Del \ Get \ Has \ Set
I also used to find a leaf one from the top root a lot in some collection services, who keeps key indexing data.
So, can we considering a new extend type or some method to operate situation like this?
Here's my thought:
typeGroup[Kcomparable, Vany] map[K][]VtypeOrderedGroup[Kcomparable, S~[]E, E cmp.Ordered] map[K]StypeUniqGroup[K ,Vcomparable] map[K]map[V]struct{}
I will supply example implementation later.
The text was updated successfully, but these errors were encountered:
Usually, we use one to one mapper: a key to a value of map, but we also like to series a dozen of values in a specific way sometimes, the result is a bunch of values mappers to the same key, that will like be:
or
url.Values
is so like this and supply some helpful method likeAdd
\Del
\Get
\Has
\Set
I also used to find a leaf one from the top root a lot in some collection services, who keeps key indexing data.
So, can we considering a new extend type or some method to operate situation like this?
Here's my thought:
I will supply example implementation later.
The text was updated successfully, but these errors were encountered: