title: Generate all permutations in go
body: <p>I am looking for a way to generate all possible permutations of a list of elements. Something similar to <a href="https://docs.python.org/2/library/itertools.html#itertools.permutations" rel="noreferrer">python's</a> <code>itertools.permutations(arr)</code></p>
  
  <pre><code>permutations ([])
  []
  
  permutations ([1])
  [1]
  
  permutations ([1,2])
  [1, 2]
  [2, 1]
  
  permutations ([1,2,3])
  [1, 2, 3]
  [1, 3, 2]
  [2, 1, 3]
  [2, 3, 1]
  [3, 1, 2]
  [3, 2, 1]
  </code></pre>
  
  <p>With the difference that I do not care whether permutations would be generated on demand (like a generator in python) or all together. I also do not care whether they will be lexicographically sorted. All I need is to somehow get these <code>n!</code> permutations.</p>