title: How can i remove duplicate structs in a Go slice
body: <p>How can i remove duplicate structs in a Go slice:</p>
  <pre><code>[{ 0 0 A  16 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
   { 0 0 A  16 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
  
    { 0 0 B  17 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
     { 0 0 B  17 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
     
      { 0 0 D  15 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
       { 0 0 D  15 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}]
  </code></pre>
  <p>I want to return only 1 instance of each struct in this slice.</p>
  <p>I tried this function</p>
  <pre><code>func unique(src []Person) []Person {
      keys := make(map[*Person]bool)
      list := []Person{}
      for _, entry := range src {
          if _, value := keys[&amp;entry]; !value {
              keys[&amp;entry] = true
              list = append(list, entry)
          }
      }
      return list
  }
  </code></pre>
  <p>but it returns only 1 item:
  <code>[{ 0 0 A  16 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}]</code></p>
  <p>vs what I want:</p>
  <pre><code>[
   { 0 0 A  16 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
  
    
     { 0 0 B  17 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}
  
   
       { 0 0 D  15 {0 0 0} {nigeria abia} {0 0}  female 0 0 false   []  map[] {false false false false false false false false false}}]
  </code></pre>