title: How can I use [20]bytes type as parameter instead of []bytes in crypto.rand.Read?
body: <p>I want to read random values into a byte array. It works like this:</p>
  
  <pre><code>hash = make([]byte,20)
  _, err := rand.Read(hash)
  </code></pre>
  
  <p>But I want to do something like</p>
  
  <pre><code>var hash [20]byte
  _, err := rand.Read(hash)
  </code></pre>
  
  <p>which results in a </p>
  
  <pre><code>cannot use hash (type [20]byte) as type []byte in argument to "crypto/rand".Read
  </code></pre>
  
  <p>How can I use a [20]byte with rand.Read?</p>