Added Reset Function

This commit is contained in:
spf13 2014-04-07 23:35:53 -04:00
parent 8b744a9310
commit 25817ada59
2 changed files with 15 additions and 15 deletions

View file

@ -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)
}

View file

@ -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())