mirror of
https://github.com/spf13/viper
synced 2024-12-22 19:47:01 +00:00
support multitype remote config file
This commit is contained in:
parent
13df721090
commit
5ada790898
1 changed files with 6 additions and 0 deletions
6
viper.go
6
viper.go
|
@ -1790,6 +1790,12 @@ func (v *Viper) getRemoteConfig(provider RemoteProvider) (map[string]interface{}
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
providerType := strings.Split(provider.Path(), ".")[len(strings.Split(provider.Path(), "."))-1]
|
||||
if v.getConfigType() == "" && stringInSlice(providerType, SupportedExts) {
|
||||
SetConfigType(providerType)
|
||||
}
|
||||
|
||||
err = v.unmarshalReader(reader, v.kvstore)
|
||||
return v.kvstore, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue