You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we can create a struct with embedded fields at runtime.
However, we cannot create methods for structs at runtime.
Below is the statement on the website of Go (https://golang.org/pkg/reflect/#StructOf).
"StructOf currently does not generate wrapper methods for embedded fields. This limitation may be lifted in a future version."
In practice, we may need to create a struct instance to implement the methods of some interfaces.
I would recommend that this feature should be implemented in Go.
What version of Go are you using (go version)?
1.8.3
The text was updated successfully, but these errors were encountered:
Currently, we can create a struct with embedded fields at runtime.
However, we cannot create methods for structs at runtime.
Below is the statement on the website of Go (https://golang.org/pkg/reflect/#StructOf).
"StructOf currently does not generate wrapper methods for embedded fields. This limitation may be lifted in a future version."
In practice, we may need to create a struct instance to implement the methods of some interfaces.
I would recommend that this feature should be implemented in Go.
What version of Go are you using (
go version
)?1.8.3
The text was updated successfully, but these errors were encountered: