mirror of
https://github.com/spf13/viper
synced 2025-05-07 20:57:18 +00:00
Merge 57c50704df
into f1d2c470bf
This commit is contained in:
commit
0f04fee204
1 changed files with 6 additions and 3 deletions
9
viper.go
9
viper.go
|
@ -1920,7 +1920,9 @@ func (v *Viper) watchKeyValueConfigOnChannel() error {
|
|||
for {
|
||||
b := <-rc
|
||||
reader := bytes.NewReader(b.Value)
|
||||
v.unmarshalReader(reader, v.kvstore)
|
||||
kvstore := make(map[string]interface{}, len(v.kvstore))
|
||||
v.unmarshalReader(reader, kvstore)
|
||||
v.kvstore = kvstore
|
||||
}
|
||||
}(respc)
|
||||
return nil
|
||||
|
@ -1952,8 +1954,9 @@ func (v *Viper) watchRemoteConfig(provider RemoteProvider) (map[string]interface
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = v.unmarshalReader(reader, v.kvstore)
|
||||
return v.kvstore, err
|
||||
kvstore := make(map[string]interface{}, len(v.kvstore))
|
||||
err = v.unmarshalReader(reader, kvstore)
|
||||
return kvstore, err
|
||||
}
|
||||
|
||||
// AllKeys returns all keys holding a value, regardless of where they are set.
|
||||
|
|
Loading…
Add table
Reference in a new issue