Open infogulch opened 11 months ago
Well it seems reflect cannot represent unexported embedded struct members:
https://go.dev/play/p/C7P38xkmjka?v=gotip
But it seems to work fine as long as the member structs are public:
I've marked #31 as draft because I found a bug in the reflect
package that causes issues with embedded fields.
Bugfix by ianlancetaylor: https://go-review.googlesource.com/c/go/+/567897
I see that last year support for embedded structs was added, but it doesn't enable the builder to create a type with embedded structs.
Something like this:
Besides the general idea of creating a new struct, do you think this is a reasonable interface? In particular if
name == ""
, then setanonymous: true
.