mirror of
https://github.com/spf13/viper.git
synced 2024-04-21 12:31:38 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user