package main import ( "fmt" "gorm.io/gorm" "reflect" ) type Person struct { name string db *gorm.DB } func main() { var person Person t1 := reflect.TypeOf(&person).Elem() t2 := reflect.TypeOf(&person).Elem() b1 := t1 == t2 fmt.Println(t1) fmt.Println(t2) fmt.Println(b1) }