What is a concise way to create a 2D slice in Go? : <p>I am learning Go by going through <a href="https://tour.golang.org/list" rel="noreferrer">A Tour of Go</a>. One of the exercises there asks me to create a 2D slice of <code>dy</code> rows and <code>dx</code> columns containing <code>uint8</code>. My current approach, which works, is this:  </p>

<pre><code>a:= make([][]uint8, dy)       // initialize a slice of dy slices
for i:=0;i&lt;dy;i++ {
    a[i] = make([]uint8, dx)  // initialize a slice of dx unit8 in each of dy slices
}
</code></pre>

<p>I think that iterating through each slice to initialize it is too verbose. And if the slice had more dimensions, the code would become unwieldy. Is there a concise way to initialize 2D (or n-dimensional) slices in Go?  </p>
