On Tue, Feb 19, 2013 at 11:15 PM, Peter Bourgon wrote:
Consider this code:
http://play.golang.org/p/SPLchMO1SC
To me, this is unexpected behavior. If a JSON object doesn't match an
explicitly-specified field tag, I expect the Unmarshaler to give up; I
don't expect it to "fall back" and try to match based on variable
name.
Thoughts?
———
My concrete problem is described by this code:
http://play.golang.org/p/HFWHTC1MAC
Consider this code:
http://play.golang.org/p/SPLchMO1SC
To me, this is unexpected behavior. If a JSON object doesn't match an
explicitly-specified field tag, I expect the Unmarshaler to give up; I
don't expect it to "fall back" and try to match based on variable
name.
Thoughts?
———
My concrete problem is described by this code:
http://play.golang.org/p/HFWHTC1MAC
tip.golang.org/pkg/encoding/json
Quoted below:
"To unmarshal JSON into a struct, Unmarshal matches incoming object keys to
the keys used by Marshal (either the struct field name or its tag),
preferring an exact match but also accepting a case-insensitive match."
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.