From a7650330d7170d0b92651446fcb7e96a489f3071 Mon Sep 17 00:00:00 2001 From: vuca Date: Mon, 26 Apr 2021 08:57:18 +0800 Subject: [PATCH] Add SetViper() function --- viper.go | 5 +++++ 1 file changed, 5 insertions(+) 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