samedi 27 mai 2017

Golang reflect getting struct members in a slice

I've the following structure:

type ProductionInfo struct {
StructA []struct {
    Field1            string
    Field2            int
}

I would extract fields name and type from StructA in the ProductionInfo type. But I cannot understand how. Can anybody help me?





Aucun commentaire:

Enregistrer un commentaire