mirror of
https://github.com/spf13/viper
synced 2025-05-06 20:27:17 +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
|
||||
}
|
||||
|
||||
if !v.caseSensitiveKeys {
|
||||
v.insensitiviseMaps()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -830,10 +826,6 @@ func (v *Viper) Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error
|
|||
return err
|
||||
}
|
||||
|
||||
if !v.caseSensitiveKeys {
|
||||
v.insensitiviseMaps()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -870,16 +862,7 @@ func (v *Viper) UnmarshalExact(rawVal interface{}) error {
|
|||
config := defaultDecoderConfig(rawVal)
|
||||
config.ErrorUnused = true
|
||||
|
||||
err := decode(v.AllSettings(), config)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !v.caseSensitiveKeys {
|
||||
v.insensitiviseMaps()
|
||||
}
|
||||
return nil
|
||||
return decode(v.AllSettings(), config)
|
||||
}
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
func (v *Viper) insensitiviseMaps() {
|
||||
insensitiviseMap(v.config)
|
||||
insensitiviseMap(v.defaults)
|
||||
insensitiviseMap(v.override)
|
||||
insensitiviseMap(v.kvstore)
|
||||
}
|
||||
|
||||
// Retrieve the first found remote configuration.
|
||||
func (v *Viper) getKeyValueConfig() error {
|
||||
if RemoteConfig == nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue