On Sun, Apr 28, 2024, 03:03 J Liu <8859210...@gmail.com> wrote: > My program is like this: > > type Girl struct { > Name string > Age int > } > > type Person struct { > girl *Girl > job string > } > > > What should I do to Marshal 'Person'? >
I think you need to export the fields, the same way like the Girl struct have them exported, ie. by making the first character of the names upper case. hth -- 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/CAA40n-W72jqdGZSKvNvkj0V1DDuJLe3GczjeOZAKAEQGU6hD2A%40mail.gmail.com.