From 346299ea79e446ebdddb834371ceba2e5926b732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 6 Aug 2016 18:06:49 +0200 Subject: [PATCH] Add getter for global Viper --- viper.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/viper.go b/viper.go index cdf2113..f17790e 100644 --- a/viper.go +++ b/viper.go @@ -450,6 +450,11 @@ func (v *Viper) SetTypeByDefaultValue(enable bool) { v.typeByDefValue = enable } +// GetViper gets the global Viper instance. +func GetViper() *Viper { + return v +} + // Viper is essentially repository for configurations // Get can retrieve any value given the key to use // Get has the behavior of returning the value associated with the first