title: Go and interface{} equality
body: <p>I have the following code:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Println(interface{}(1) == interface{}(1))
  
      var a *int
      fmt.Println(a == nil)
      fmt.Println(interface{}(a) == interface{}(nil))
  }
  </code></pre>
  
  <p>and it outputs:</p>
  
  <pre><code>true
  true
  false
  </code></pre>
  
  <p>I'm wondering why. In the first case it can be seen that wrapping a value in an <code>interface{}</code> doesn't stop equality from being determined, and yet a nil pointer (which is equal to <code>nil</code>) wrapped in an <code>interface{}</code> is not the same as <code>interface{}(nil)</code>. Why is this?</p>