Given a struct CompleteStruct that is composed of two embedded structs StructA and StructB where StructB has ImbStructC in it.
type StructA struct {
AA int
AB int
AC int
}
type ImbStructC struct {
BCC int
}
type StructB struct {
BA int
BB int
ImbStructC
}
type CompleteStruct struct {
StructA
StructB
}
How do you extract the total number of fields in the inner struct?
reflect.TypeOf(CompleteStruct{}).NumField())
returns 2, I assume because CompleteStruct is made up of 2 embedded structs.
What code can I use to show that CompleteStruct has 6 fields?