How to cast reflect.Value to its type?
type Cat struct { Age int } cat := reflect.ValueOf(obj) fmt.Println(cat.Type()) // Cat fmt.Println(Cat(cat).Age) //
concreteCat,_ := reflect.ValueOf(cat).Interface().(Cat)
see http://golang.org/doc/articles/laws_of_reflection.html fox example
type MyInt int var x MyInt = 7 v := reflect.ValueOf(x) y := v.Interface().(float64) // y will have type float64. fmt.Println(y)