Move viper.Reset() back to the public interface - viper - [fork] go viper port for 9front
(HTM) git clone git@git.drkhsh.at/viper.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 90734830d1ec30c19cb03e3ecd76a43dc1618b01
(DIR) parent 6c5a915341f6d411a84ac2ee5a99569c2bc4b7f4
(HTM) Author: Ross Cooperman <rcooperman@movableink.com>
Date: Thu, 19 Feb 2015 10:39:44 -0500
Move viper.Reset() back to the public interface
It is helpful for applications that use viper to be able to
reset their configurations between test runs.
Diffstat:
M viper.go | 9 +++++++++
M viper_test.go | 7 -------
2 files changed, 9 insertions(+), 7 deletions(-)
---
(DIR) diff --git 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
(DIR) diff --git 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",