mirror of
https://github.com/spf13/viper
synced 2025-01-22 10:26:36 +00:00
Clean config register before reading in from file in order to avoid stale values
This commit is contained in:
parent
ba3382dd23
commit
54e585af54
1 changed files with 2 additions and 0 deletions
2
viper.go
2
viper.go
|
@ -677,6 +677,8 @@ func (v *Viper) ReadInConfig() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v.config = make(map[string]interface{})
|
||||||
|
|
||||||
v.marshalReader(bytes.NewReader(file), v.config)
|
v.marshalReader(bytes.NewReader(file), v.config)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue