title: How do I remove duplicates from a struct slice?
body: <p>I have a struct like this:</p>
  <pre class="lang-golang prettyprint-override"><code>type structData struct {
        dataName string
        dataNum int
  }
  </code></pre>
  <p>And I have created a slice out of them, like so:</p>
  <pre class="lang-golang prettyprint-override"><code>dataSlice := []*structData{}
  </code></pre>
  <p>I have a loop that populates the <code>dataName</code> string and just after this, I want the struct slice to be checked through and duplicates removed.
  I mention this specifically because currently, <code>dataNum</code> is 0. So, I don't want to check if the string inside my struct is same or not, it is totally fine checking if the entire struct is equal (if that's possible, else it is also OKAY for me to check duplicates in the <code>dataName</code> string, I just don't know what would look better in design).</p>
  <p>An example output of what my struct slice looks like:</p>
  <pre class="lang-golang prettyprint-override"><code>&amp;{dataname1 0}
  &amp;{dataname1 0}
  &amp;{dataname2 0}
  &amp;{dataname2 0}
  </code></pre>
  <p>What I want it to look like:</p>
  <pre class="lang-golang prettyprint-override"><code>&amp;{dataname1 0}
  &amp;{dataname2 0}
  </code></pre>