insensitivise slices of maps when reading from config file

This commit is contained in:
cmohrb 2018-08-22 11:28:42 +02:00
parent 8e90aaafac
commit 4f738d6f3f
1 changed files with 7 additions and 0 deletions

View File

@ -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)