How can I get the same value as reflect.TypeOf(struct.field)
when using FieldByName
when the field is an interface type?
As seen here, if a struct field is an interface, reflect.TypeOf(struct.field)
gives me the concrete type, but reflect.ValueOf(struct).FieldByName("field").Type()
gives me the interface. Is it possible to get the concrete type stored in struct.field
using reflect if all I have is struct
and "field"
?