Added Reset Function
diff --git a/viper.go b/viper.go
index ff5549a..b53c26a 100644
--- a/viper.go
+++ b/viper.go
@@ -385,3 +385,18 @@
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 @@
}
}`)
-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())