title: Set of structs containing a slice
body: <p>I'm trying to implement a toy search algorithm and need to maintain a set of explored states. A state is a struct:</p>
  
  <pre><code>type VWState struct {
      botLocation   VWCoords
      dirtLocations []VWCoords
  }
  </code></pre>
  
  <p>My first thought was that a simple Set could be implemented using a <code>map[VWState]bool</code>, but I can't seem to figure out a way to make it work. If I try to use a <code>VWState</code> as a key to a map, I get the following panic:</p>
  
  <pre><code>Panic: runtime error: hash of unhashable type vw.VWState (PC=0x40EB0D)
  </code></pre>
  
  <p>Is there a way to make this work? Can I implement a custom hashing function for the struct, or should I be looking at some other ways to implement this?</p>
  
  <p>Any help would be greatly appreciated.</p>