mardi 30 mai 2017

Goalng reflect SetString

I have a struct like this one:

type ProductionInfo struct {
    StructA []Entry
}

type Entry struct {
    Field1 string
    Field2 int
}

I would like to change the value of Field1 using reflection but the reflect object returned always CanSet() = false. What can I do? See playground example.

http://ift.tt/2ric19t





Aucun commentaire:

Enregistrer un commentaire