On Monday, 12 June 2023 at 07:55:24 UTC+1 Brian Candler wrote: I don't know if it's possible to use 'reflect' to build the struct type dynamically
FWIW, I tried it, but could only make a program which crashes spectacularly. https://go.dev/play/p/BIFFT3FgUrz There is a comment in the documentation of reflect.StructOf <https://pkg.go.dev/reflect#StructOf> which may or may not be relevant: *StructOf currently does not generate wrapper methods for embedded fields and panics if passed unexported StructFields. These limitations may be lifted in a future version.* -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1865cc1f-503a-4f58-bcd3-b7bb044aaf60n%40googlegroups.com.