title: Check type of struct in Go
body: <p>I'm trying to check the type of a struct in Go. This was the best way I could come up with. Is there a better way to do it, preferably without initializing a struct?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "reflect"
  )
  
  type Test struct{
      foo int
  }
  
  func main() {
      t := Test{5}
      fmt.Println(reflect.TypeOf(t) == reflect.TypeOf(Test{}))
  }
  </code></pre>