var whatIsIt interface{} // passed in
type := reflect.TypeOf(whatIsIt)
for i := 0; i < typ.NumField(); i++ {
f := typ.Field(i)
if f.Type.Kind() == reflect.Ptr {
var num int
if f.Type.AssignableTo(reflect.ValueOf(&num).Type()) {
fmt.Println("it is a pointer to int")
}
}
}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.