mirror of
https://github.com/spf13/viper
synced 2024-12-23 12:07:02 +00:00
insensitivise slices of maps when reading from config file
This commit is contained in:
parent
8e90aaafac
commit
4f738d6f3f
1 changed files with 7 additions and 0 deletions
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 a new issue