title: How do I create a map[[16]byte][]string in Go?
body: <p>The Go spec <a href="http://golang.org/doc/go_spec.html#Map_types" rel="noreferrer">states</a>:</p>
  
  <blockquote>
    <p>The comparison operators == and != (§Comparison operators) must be fully defined for operands of the key type; thus the key type must not be a struct, array or slice. If the key type is an interface type, these comparison operators must be defined for the dynamic key values; failure will cause a run-time panic.</p>
  </blockquote>
  
  <p>I wish to create a map of hash values which come from the <a href="http://golang.org/src/pkg/hash/hash.go#L10" rel="noreferrer">Hash</a> interface, which returns <code>[]byte</code>, but for which all my hashes are done with the same algorithm (thereby I know that it would fit into <code>[16]byte</code>). How can I provide the appropriate interface such that the <code>map</code> type will allow <code>[]byte</code> or <code>[16]byte</code> or some wrapper thereof to be used as a key?</p>
  
  <p>Presently my use generates the following error:</p>
  
  <pre><code>dupes := make(map[[16]byte][]string)
  </code></pre>
  
  <pre>finddups.go:55: invalid map key type [16]uint8</pre>
  
  <hr>
  
  <p><em>Update (Mar 2012):</em> Go1 allows <code>[16]byte</code> as key type.</p>