This commit is contained in:
Alexandre Bourget 2017-04-17 21:08:54 +00:00 committed by GitHub
commit afd117e0d8

View file

@ -184,6 +184,18 @@ func New() *Viper {
return v return v
} }
// DefaultConfig retrieves the default Viper instance. To be loaded
// later with SetDefaultConfig.
func DefaultConfig() *Viper {
return v
}
// SetDefaultConfig applies this Viper instance as the default. Used
// when calling the functions defined in the viper package.
func SetDefaultConfig(conf *Viper) {
v = conf
}
// Intended for testing, will reset all to default settings. // Intended for testing, will reset all to default settings.
// In the public interface for the viper package so applications // In the public interface for the viper package so applications
// can use it in their testing as well. // can use it in their testing as well.