lundi 27 avril 2020

How do I get keys of an embedded struct using reflection? [duplicate]

I have a struct A

type A struct {
   KeyA string 
}

and I have another struct B

type B struct {
   A
   KeyB string
}

How do I access all the keys name Both KeyA and KeyB using only struct B with relection api . I have tried Get name of struct field using reflection but it only gives KeyB





Aucun commentaire:

Enregistrer un commentaire