diff --git a/viper.go b/viper.go index 50b4780..4622b48 100644 --- a/viper.go +++ b/viper.go @@ -781,6 +781,11 @@ func GetViper() *Viper { return v } +// SetViper sets the global Viper instance. +func SetViper(vp *Viper) { + v=vp +} + // Get can retrieve any value given the key to use. // Get is case-insensitive for a key. // Get has the behavior of returning the value associated with the first