title: How do I allocate memory for an array in the go programming language?
body: <p>I want to make an array of size N in go, but I don't know what N will be at compile time, how would I allocate memory for it?</p>
  
  <p>e.g. </p>
  
  <pre><code>func MakeArray(size int) {
    return new ([size]int)
  }
  </code></pre>
  
  <p>which doesn't work since size is not a constant. </p>
  
  <p>This seems like a simple question, but I just started using go and it's not obvious to me how to do this from reading the tutorial (or searching the documentation for that matter).</p>