title: Golang convert interface{} to array of N size
body: <p>I have an array of <code>T</code> wrapped in an interface. I know the size of the array beforehand. How do I write a generic function that gets back an array (or a slice) for any array length? E.g. for size 3 I want something like</p>
  
  <pre><code>var values interface{} = [3]byte{1, 2, 3}
  var size = 3 // I know the size
  
  var _ = values.([size]byte) // wrong, array bound must be a const expression
  </code></pre>
  
  <p>I can't really do a type switch because <code>[1]byte</code> is a different type from <code>[2]byte</code> etc so I'd have to explicitly enumerate all possible sizes.</p>