title: Randomly generating a matrix in Golang
body: <p>I'm currently writing a program and I want to randomly generate a matrix.</p>
  
  <p>Currently I'm pre-setting the values in it as follows:</p>
  
  <pre><code>    m1 := [3][3]int{
      [3]int{1, 1, 1},
      [3]int{4, 1, 7},
      [3]int{1, 65, 1},
  }
  </code></pre>
  
  <p>However I want the values inputted to be randomly generated in a range from 1-100.</p>
  
  <pre><code>import "math/rand"
  </code></pre>
  
  <p>I am importing the above library and trying to utilise it.</p>
  
  <p>I have attempted to get this working however can't seem to make any headway. </p>
  
  <pre><code>    m1 := [3][3]int{
      [3]int{rand.Intn, 1, 1},
      [3]int{4, 1, 7},
      [3]int{1, 65, 1},
  }
  </code></pre>
  
  <p>I have attempted to complete it with the above solution to make the first number random however I get the following error.</p>
  
  <pre><code>cannot use rand.Intn (type func(int) int) as type int in array or slice literal
  </code></pre>
  
  <p>Any help greatly appreciated.</p>