title: Remove duplicates from map of slices
body: <p>I have a map of slices that I need to remove duplicates from. I think I'm close to the solution but I'm missing something that I can't quite figure out.</p>
  
  <p>Expected output: <code>map[key1:[1 2 3] key2:[1 2 3]]</code></p>
  
  <p>Actual output: <code>map[key2:[1 2 3]]</code></p>
  
  <pre class="lang-golang prettyprint-override"><code>    package main
  
      import "fmt"
  
      func main() {
          x := make(map[string][]string)
          keys := make(map[string]bool)
          result := make(map[string][]string)
  
          x["key1"] = append(x["key1"], "1")
          x["key1"] = append(x["key1"], "1")
          x["key1"] = append(x["key1"], "2")
          x["key1"] = append(x["key1"], "3")
          x["key1"] = append(x["key1"], "3")
          x["key2"] = append(x["key2"], "1")
          x["key2"] = append(x["key2"], "2")
          x["key2"] = append(x["key2"], "2")
          x["key2"] = append(x["key2"], "3")
  
          fmt.Println(x)
  
          for k, e := range x{
              for _, v := range e {
                  if _, val := keys[v]; !val {
                      keys[v] = true
                      result[k] = append(result[k], v)
                  }
              }
          }
          fmt.Println(result)
      }
  </code></pre>
  
  <p>Example on the playground here: <a href="https://play.golang.org/p/HbycgyC5SI6" rel="nofollow noreferrer">Go Playground</a></p>