mirror of
https://github.com/spf13/viper
synced 2025-05-07 12:47:18 +00:00
Merge removal of insensitiviseMaps()
This commit is contained in:
commit
3954e41520
1 changed files with 1 additions and 25 deletions
26
viper.go
26
viper.go
|
@ -811,10 +811,6 @@ func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConf
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !v.caseSensitiveKeys {
|
|
||||||
v.insensitiviseMaps()
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -830,10 +826,6 @@ func (v *Viper) Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !v.caseSensitiveKeys {
|
|
||||||
v.insensitiviseMaps()
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,16 +862,7 @@ func (v *Viper) UnmarshalExact(rawVal interface{}) error {
|
||||||
config := defaultDecoderConfig(rawVal)
|
config := defaultDecoderConfig(rawVal)
|
||||||
config.ErrorUnused = true
|
config.ErrorUnused = true
|
||||||
|
|
||||||
err := decode(v.AllSettings(), config)
|
return decode(v.AllSettings(), config)
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !v.caseSensitiveKeys {
|
|
||||||
v.insensitiviseMaps()
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BindPFlags binds a full flag set to the configuration, using each flag's long
|
// BindPFlags binds a full flag set to the configuration, using each flag's long
|
||||||
|
@ -1595,13 +1578,6 @@ func (v *Viper) WatchRemoteConfigOnChannel() error {
|
||||||
return v.watchKeyValueConfigOnChannel()
|
return v.watchKeyValueConfigOnChannel()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Viper) insensitiviseMaps() {
|
|
||||||
insensitiviseMap(v.config)
|
|
||||||
insensitiviseMap(v.defaults)
|
|
||||||
insensitiviseMap(v.override)
|
|
||||||
insensitiviseMap(v.kvstore)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retrieve the first found remote configuration.
|
// Retrieve the first found remote configuration.
|
||||||
func (v *Viper) getKeyValueConfig() error {
|
func (v *Viper) getKeyValueConfig() error {
|
||||||
if RemoteConfig == nil {
|
if RemoteConfig == nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue