I would like to manipulate structs at Runtime.
For example, I have a struct:
type Item struct {
SomeField string
}
Is it possible to add field on runtime? Or Access Attribute that is not yet defined. Something like pythons __getattr__() or __call__(
) so I could dynamically control the fields/methods accessed.
E.g. do something like
Item.DynamicField or Item.DynamicMethod()
where I don't know exactly the Field or the Method that will be accessed/called, So I can't define it statically.
Maybe I'm missing something in the Reflect package?
Thank you.