How can I set a nil struct to its zero value using reflection? I already tried the following:
v.Interface() = reflect.Zero(f.Type)
Where v is the reflect.Value and f is the reflect.StructField of a struct field.
v
reflect.Value
f
reflect.StructField
Aucun commentaire:
Enregistrer un commentaire