mirror of
https://github.com/spf13/viper
synced 2024-12-22 03:27:03 +00:00
add readremoteconfig for cases when there are no local configuration files
This commit is contained in:
parent
f8939d9229
commit
c33e690687
1 changed files with 7 additions and 1 deletions
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 a new issue