diff --git a/viper.go b/viper.go index 89834b7..dda7091 100644 --- a/viper.go +++ b/viper.go @@ -102,6 +102,15 @@ func New() *viper { return v } +// Intended for testing, will reset all to default settings. +// In the public interface for the viper package so applications +// can use it in their testing as well. +func Reset() { + v = New() + SupportedExts = []string{"json", "toml", "yaml", "yml"} + SupportedRemoteProviders = []string{"etcd", "consul"} +} + // remoteProvider stores the configuration necessary // to connect to a remote key/value store. // Optional secretKeyring to unencrypt encrypted values diff --git a/viper_test.go b/viper_test.go index 92e62cc..2c665ec 100644 --- a/viper_test.go +++ b/viper_test.go @@ -54,13 +54,6 @@ var jsonExample = []byte(`{ } }`) -// Intended for testing, will reset all to default settings. -func Reset() { - v = New() - SupportedExts = []string{"json", "toml", "yaml", "yml"} - SupportedRemoteProviders = []string{"etcd", "consul"} -} - var remoteExample = []byte(`{ "id":"0002", "type":"cronut",