Open andig opened 2 years ago
https://pkg.go.dev/github.com/mitchellh/mapstructure#DecoderConfig : MatchName
// MatchName is the function used to match the map key to the struct
// field name or tag. Defaults to `strings.EqualFold`. This can be used
// to implement case-sensitive tag values, support snake casing, etc.
MatchName func(mapKey, fieldName [string](https://pkg.go.dev/builtin#string)) [bool](https://pkg.go.dev/builtin#bool)
I don't think that applies here. This will match decoding into a struct, I'm decoding into a map?
I have a situation where I don't know the target struct and hence decode into a map. This will create duplicate keys if input has multiple types of key case. It would be helpful if I could deduplicate the keys in a case insensitive way.