mirror of https://github.com/spf13/viper.git
support multitype remote config file
This commit is contained in:
parent
13df721090
commit
5ada790898
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 New Issue