Hi,
Once a struct is declared
type M struct{}
is it possible to later add properties to the struct so it can become something like
type M struct{
name string
}
by using some function that would modify the original struct?
Thanks!
Alex
Hi,
Once a struct is declared
type M struct{}
is it possible to later add properties to the struct so it can become something like
type M struct{
name string
}
by using some function that would modify the original struct?
Thanks!
Alex
No, types can not be changed. (Other than by changing the source and recompiling.)
No, but you can maybe use map.
Agreed. The OP sounds like need map instead of struct.
Thanks all! I’ll see where I get to using a map instead .
Cheers!
Alex
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.