mirror of
https://github.com/spf13/viper
synced 2024-11-16 10:07:00 +00:00
fix watchKeyValueConfigOnChannel panic when remote config update
This commit is contained in:
parent
5d65186f1e
commit
104f9d0771
1 changed files with 3 additions and 1 deletions
4
viper.go
4
viper.go
|
@ -1882,7 +1882,9 @@ func (v *Viper) watchKeyValueConfigOnChannel() error {
|
|||
for {
|
||||
b := <-rc
|
||||
reader := bytes.NewReader(b.Value)
|
||||
v.unmarshalReader(reader, v.kvstore)
|
||||
kvstore := make(map[string]interface{})
|
||||
v.unmarshalReader(reader, kvstore)
|
||||
v.kvstore = kvstore
|
||||
}
|
||||
}(respc)
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue