From d2baef097ee96f8fe6f84113a6fb90a16efb485f Mon Sep 17 00:00:00 2001 From: Paul Fawkesley Date: Wed, 31 Oct 2018 15:54:02 +0000 Subject: [PATCH] map InvalidBackend to (default) empty string this means that by *default*, if anyone's using a `BackendType` and they've forgotten to initialize it (like on a struct, for example), then the default empty string will automatically compare equal to `InvalidBackend` Otherwise, if code wants to switch on the backend type, really they've gotta check for `InvalidBackend` *and* empty string `""` --- keyring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyring.go b/keyring.go index ad5f481..3bce04e 100644 --- a/keyring.go +++ b/keyring.go @@ -10,7 +10,7 @@ import ( // All currently supported secure storage backends const ( - InvalidBackend BackendType = "invalid" + InvalidBackend BackendType = "" SecretServiceBackend BackendType = "secret-service" KeychainBackend BackendType = "keychain" KWalletBackend BackendType = "kwallet"