Skip to content

UnmarshalKey normalizes all map keys to lower case #373

@lnashier

Description

@lnashier
{
   "someKey": 1,
   "myMap": {
       "A": "v1",
       "B": "v2"
   }
}
config := viper.New()
config.AddConfigPath("myconfigpath")
config.SetConfigName("myconfig")
var myMap map[string]string
config.UnmarshalKey("myMap", &myMap)

myMap has all lower-cased keys.

Can somebody comment if it is expected or is it a bug ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions