I know how to sort key/value with data type:
map[1:a 2:c 0:b]
using sort
package of GoLang. How can I sort a Pair
like the following:
[{c 2} {a 1} {b 0}]
I want the whole pair to be sorted either according to key or value? End result:
[{a 1} {b 0} {c 2}]
this is sorted according to keys. Below is sorted according to values:
[{b 0} {a 1} {c 2}]