mirror of
https://github.com/spf13/viper
synced 2024-12-22 19:47:01 +00:00
:%s/insensativiseMap/insensitiviseMap/g
This commit is contained in:
parent
8b99f53550
commit
5b0b926e3d
2 changed files with 8 additions and 8 deletions
4
util.go
4
util.go
|
@ -25,7 +25,7 @@ import (
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func insensativiseMap(m map[string]interface{}) {
|
func insensitiviseMap(m map[string]interface{}) {
|
||||||
for key, val := range m {
|
for key, val := range m {
|
||||||
lower := strings.ToLower(key)
|
lower := strings.ToLower(key)
|
||||||
if key != lower {
|
if key != lower {
|
||||||
|
@ -137,5 +137,5 @@ func marshallConfigReader(in io.Reader, c map[string]interface{}, configType str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
insensativiseMap(c)
|
insensitiviseMap(c)
|
||||||
}
|
}
|
||||||
|
|
12
viper.go
12
viper.go
|
@ -361,7 +361,7 @@ func (v *viper) Marshal(rawVal interface{}) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
v.insensativiseMaps()
|
v.insensitiviseMaps()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -612,11 +612,11 @@ func (v *viper) marshalReader(in io.Reader, c map[string]interface{}) {
|
||||||
marshallConfigReader(in, c, v.getConfigType())
|
marshallConfigReader(in, c, v.getConfigType())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *viper) insensativiseMaps() {
|
func (v *viper) insensitiviseMaps() {
|
||||||
insensativiseMap(v.config)
|
insensitiviseMap(v.config)
|
||||||
insensativiseMap(v.defaults)
|
insensitiviseMap(v.defaults)
|
||||||
insensativiseMap(v.override)
|
insensitiviseMap(v.override)
|
||||||
insensativiseMap(v.kvstore)
|
insensitiviseMap(v.kvstore)
|
||||||
}
|
}
|
||||||
|
|
||||||
// retrieve the first found remote configuration
|
// retrieve the first found remote configuration
|
||||||
|
|
Loading…
Reference in a new issue