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
{{ message }}
Repository navigation
[bug] Mapstructure handles fields with different case twice #75
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
We can confirm this behavior (see playground): if our struct defines a tag with a different case, it will fall back to it, but if there are 2 fields, 1 with the right, 1 with the wrong case, it will select the correct one.
However, in this specific case, mapstructure handles things differently (see playground): the field is present twice, with both the case-correct and case-incorrect values.
Activity