From fe1a85f1e9724d6b0416dc32aa58c2243d727b8a Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 2 Apr 2019 11:20:59 +0200 Subject: [PATCH] cli/command/trust/key_generate.go:112:9: nilness: impossible condition: nil != nil (govet) Signed-off-by: Silvin Lubecki (cherry picked from commit f5e8387067a45cb519fb96a1840f61c82506fd20) Signed-off-by: Sebastiaan van Stijn --- cli/command/trust/key_generate.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/command/trust/key_generate.go b/cli/command/trust/key_generate.go index 47223c3d9d..5e4661eafb 100644 --- a/cli/command/trust/key_generate.go +++ b/cli/command/trust/key_generate.go @@ -108,8 +108,7 @@ func generateKeyAndOutputPubPEM(keyName string, privKeyStore trustmanager.KeySto return pem.Block{}, err } - privKeyStore.AddKey(trustmanager.KeyInfo{Role: data.RoleName(keyName)}, privKey) - if err != nil { + if err := privKeyStore.AddKey(trustmanager.KeyInfo{Role: data.RoleName(keyName)}, privKey); err != nil { return pem.Block{}, err }