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