mirror of
https://github.com/spf13/viper
synced 2024-11-04 20:27:02 +00:00
remote: fix two dropped errors
This commit is contained in:
parent
99520c81d8
commit
583f79b3ea
1 changed files with 3 additions and 2 deletions
|
@ -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 a new issue