mirror of https://github.com/spf13/viper.git
remote: fix two dropped errors
This commit is contained in:
parent
99520c81d8
commit
583f79b3ea
|
@ -77,11 +77,12 @@ func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if rp.SecretKeyring() != "" {
|
if rp.SecretKeyring() != "" {
|
||||||
kr, err := os.Open(rp.SecretKeyring())
|
var kr *os.File
|
||||||
defer kr.Close()
|
kr, err = os.Open(rp.SecretKeyring())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
defer kr.Close()
|
||||||
if rp.Provider() == "etcd" {
|
if rp.Provider() == "etcd" {
|
||||||
cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr)
|
cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue