mirror of https://github.com/spf13/viper.git
insensitivise slices of maps when reading from config file
This commit is contained in:
parent
8e90aaafac
commit
4f738d6f3f
7
util.go
7
util.go
|
@ -76,6 +76,13 @@ func insensitiviseMap(m map[string]interface{}) {
|
||||||
case map[string]interface{}:
|
case map[string]interface{}:
|
||||||
// nested map: recursively insensitivise
|
// nested map: recursively insensitivise
|
||||||
insensitiviseMap(val.(map[string]interface{}))
|
insensitiviseMap(val.(map[string]interface{}))
|
||||||
|
case []interface{}:
|
||||||
|
for _, x := range val.([]interface{}) {
|
||||||
|
y, ok := x.(map[string]interface{})
|
||||||
|
if ok {
|
||||||
|
insensitiviseMap(y)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lower := strings.ToLower(key)
|
lower := strings.ToLower(key)
|
||||||
|
|
Loading…
Reference in New Issue