Skip to content

Commit

Permalink
explicitly map the default backend selection choice to "automatic" to…
Browse files Browse the repository at this point in the history
… improve error messages
  • Loading branch information
joemiller committed Jun 3, 2021
1 parent 68914db commit 1099506
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ func initBackend() error {
WinCredPrefix: cfg.WinCred.Prefix,
}

// rename the default backendtype to 'automatic' to make potential error messages more useful:
if cfg.BackendType == "" {
cfg.BackendType = "automatic"
}

switch cfg.BackendType {
case "automatic", "":
case "automatic":
storeCfg.AllowedBackends = store.SupportedBackends
case "keychain":
storeCfg.AllowedBackends = []keyring.BackendType{keyring.KeychainBackend}
Expand Down

0 comments on commit 1099506

Please sign in to comment.