You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the matching is a many to one mapping from json data to struct fields, in the order that the data is presented, so length matches and its value is assigned to the field, then it sees Length, which also matches the field so the data is overwritten (it doesn't record whether a field was seen before). You can observe the effect if you switch the order of the fields in json.
unfortunate, but I believe this is working as intended.
Go version
go1.21.4 darwin/arm64 (but also go.1.22)
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/vOphzSORsXL
What did you see happen?
error: {not an exact match with tag}
What did you expect to see?
I have a struct with a field whose tag is an exact match of the JSON key. However, the decoder picks the JSON key with a case-insensitive match.
The text was updated successfully, but these errors were encountered: