mirror of
https://github.com/spf13/viper
synced 2024-12-22 19:47:01 +00:00
Add getter for global Viper
This commit is contained in:
parent
abafbf243b
commit
346299ea79
1 changed files with 5 additions and 0 deletions
5
viper.go
5
viper.go
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue