Clean config register before reading in from file in order to avoid stale values

This commit is contained in:
Kiril Zvezdarov 2015-04-26 15:08:10 -04:00
parent ba3382dd23
commit 54e585af54
1 changed files with 2 additions and 0 deletions

View File

@ -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
} }