From 25817ada5921b507db5ffc42f3afc6f09b853ac6 Mon Sep 17 00:00:00 2001 From: spf13 Date: Mon, 7 Apr 2014 23:35:53 -0400 Subject: [PATCH] Added Reset Function --- viper.go | 15 +++++++++++++++ viper_test.go | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/viper.go b/viper.go index ff5549a..b53c26a 100644 --- a/viper.go +++ b/viper.go @@ -385,3 +385,18 @@ func Debug() { fmt.Println("Override:") pretty.Println(override) } + +func Reset() { + configPaths = nil + configName = "config" + + // extensions Supported + SupportedExts = []string{"json", "toml", "yaml"} + configFile = "" + configType = "" + + config = make(map[string]interface{}) + override = make(map[string]interface{}) + defaults = make(map[string]interface{}) + aliases = make(map[string]string) +} diff --git a/viper_test.go b/viper_test.go index 1aba562..01beac9 100644 --- a/viper_test.go +++ b/viper_test.go @@ -43,21 +43,6 @@ var jsonExample = []byte(`{ } }`) -func reset() { - configPaths = nil - configName = "config" - - // extensions Supported - SupportedExts = []string{"json", "toml", "yaml"} - configFile = "" - configType = "" - - config = make(map[string]interface{}) - override = make(map[string]interface{}) - defaults = make(map[string]interface{}) - aliases = make(map[string]string) -} - func TestBasics(t *testing.T) { SetConfigFile("/tmp/config.yaml") assert.Equal(t, "/tmp/config.yaml", getConfigFile())