For example we have a struct:
type Test struct {
F map[string]string}
if we initialize an instance of that struct witho := reflect.New(reflect.TypeOf(Test{}))
now the field F is nilI attempt to set the field F to a new map:o.FieldByName("F").Set(reflect.MakeMap(...))however this fails with something like "cannot set to zero value" because the field is nil, it cannot be set
so how do I initialize the field?
basically it's something like `o.F = make(map[string]string)`
Oh sorry I was in a hurry and typed it wrong, it should have been F, this question is not about that (ofc. I know reflection doesn't work with unexported field).
It's about Initializing a field which is a map that is nil when the struct get created.