Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/json: Unmarshal ignore the exact case and match the case-intensitive one and throw an error #15232
Please answer these questions before submitting your issue. Thanks!
The Get function called
which Name is an array and name is a string
This is working as intended (documented). Quote https://golang.org/pkg/encoding/json/#Unmarshal: 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. When encoding/json finds the Name key, it finds that it matches the field tag case-insensitively, and try to unmarshal it into the field and get an error.