mirror of https://github.com/spf13/viper.git
add readremoteconfig for cases when there are no local configuration files
This commit is contained in:
parent
f8939d9229
commit
c33e690687
8
viper.go
8
viper.go
|
@ -468,7 +468,13 @@ func ReadInConfig() error {
|
|||
MarshallReader(bytes.NewReader(file), config)
|
||||
return nil
|
||||
}
|
||||
|
||||
func ReadRemoteConfig() error {
|
||||
err := getKeyValueConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func MarshallReader(in io.Reader, c map[string]interface{}) {
|
||||
buf := new(bytes.Buffer)
|
||||
buf.ReadFrom(in)
|
||||
|
|
Loading…
Reference in New Issue