mirror of
https://github.com/spf13/viper
synced 2025-05-06 12:17:18 +00:00
Fix: insensitiviseMaps() made recursive
So that nested keys are lowercased
This commit is contained in:
parent
4db0eb0976
commit
a60edc6a52
1 changed files with 4 additions and 0 deletions
4
util.go
4
util.go
|
@ -45,6 +45,10 @@ func insensitiviseMap(m map[string]interface{}) {
|
||||||
if key != lower {
|
if key != lower {
|
||||||
delete(m, key)
|
delete(m, key)
|
||||||
m[lower] = val
|
m[lower] = val
|
||||||
|
if m2, ok := val.(map[string]interface{}); ok {
|
||||||
|
// nested map: recursively insensitivise
|
||||||
|
insensitiviseMap(m2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue