Re: [go-nuts] alternate struct tags for json encode/decode?
It wasn’t always possible. I think this ability was added around 1.8 to expressly make multiple “views” of a struct easier by ignoring tags in the identity of the struct: https://go-review.googlesource.com/c/go/+/30169 -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] alternate struct tags for json encode/decode?
oh, cool! I had no idea that was doable (makes sense in retrospect but..). That would kind of suit a lot of the cases I care about. thanks, -reed On Thursday, 12 April 2018 00:57:20 UTC+12, Jan Mercl wrote: > > On Wed, Apr 11, 2018 at 2:50 PM Reed Wade> wrote: > > > Is there a sensible existing way to do that? Would this be a useful > update to the lib? > > Not very nice, but: https://play.golang.org/p/gkWEuV1AlwB > > > -- > > -j > -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] alternate struct tags for json encode/decode?
On Wed, Apr 11, 2018 at 2:50 PM Reed Wadewrote: > Is there a sensible existing way to do that? Would this be a useful update to the lib? Not very nice, but: https://play.golang.org/p/gkWEuV1AlwB -- -j -- 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. For more options, visit https://groups.google.com/d/optout.