title: Ways to compare two golang lists to check all elements are unique
body: <p>Question is as stated in the title. Given two lists of known types, and you just wanted to make sure that both lists aren't using any of the same elements, how do you check that efficiently in golang.</p>
  
  <p>Still relatively new to golang. In Python, I would probably do something like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>a = [1, 2, 3]
  b = [4, 5, 6]
  c = [7, 8, 1]
  
  def check_lists_are_unique(list_one, list_two):
      return not bool(len(set(list_one) &amp; set(list_two)))
  
  print(check_lists_are_unique(a, b)) # returns True
  print(check_lists_are_unique(a, c)) # returns False
  print(check_lists_are_unique(b, c)) # returns True
  </code></pre>
  
  <p>My own naive first attempt in golang would be:</p>
  
  <pre class="lang-golang prettyprint-override"><code>a := []int{1, 2, 3}
  b := []int{4, 5, 6}
  c := []int{7, 8, 1}
  
  checkUnique := func(listOne, listTwo []int) bool {
      for _, i := range listOne {
          for _, j := range listTwo {
              if i == j {
                  return false
              }
          }
      }
      return true
  }
  fmt.Println(checkUnique(a, b)) // returns true
  fmt.Println(checkUnique(a, c)) // returns false
  fmt.Println(checkUnique(b, c)) // returns true
  </code></pre>
  
  <p><a href="https://play.golang.org/p/vuBnv97MyWb" rel="nofollow noreferrer">https://play.golang.org/p/vuBnv97MyWb</a></p>
  
  <p>Was wondering if this is really the most efficient way to do this comparison in golang? Are there alternatives or a more "correct" way of doing this comparison in golang?</p>
  
  <p>Extra note: Would also like to hear any cool/creative/wacky ways of doing this that are uniquely golang-ish. </p>