Add getter for global Viper

This commit is contained in:
Bjørn Erik Pedersen 2016-08-06 18:06:49 +02:00
parent abafbf243b
commit 346299ea79
1 changed files with 5 additions and 0 deletions

View File

@ -450,6 +450,11 @@ func (v *Viper) SetTypeByDefaultValue(enable bool) {
v.typeByDefValue = enable v.typeByDefValue = enable
} }
// GetViper gets the global Viper instance.
func GetViper() *Viper {
return v
}
// Viper is essentially repository for configurations // Viper is essentially repository for configurations
// Get can retrieve any value given the key to use // Get can retrieve any value given the key to use
// Get has the behavior of returning the value associated with the first // Get has the behavior of returning the value associated with the first