From 9cc20a29ce3ebf6cac7b059785055697635cca6f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 29 Mar 2023 15:33:35 +0200 Subject: [PATCH] cli/command/context: remove redundant if ...; err != nil check (revive) cli/command/context/create.go:121:2: if-return: redundant if ...; err != nil check, just return error instead. (revive) if err := s.ResetTLSMaterial(o.Name, &contextTLSData); err != nil { return err } Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 78c474539bf3573ad044747dee2277953c296aba) Signed-off-by: Sebastiaan van Stijn --- cli/command/context/create.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cli/command/context/create.go b/cli/command/context/create.go index d912dff375..757d40adef 100644 --- a/cli/command/context/create.go +++ b/cli/command/context/create.go @@ -118,10 +118,7 @@ func createNewContext(o *CreateOptions, cli command.Cli, s store.Writer) error { if err := s.CreateOrUpdate(contextMetadata); err != nil { return err } - if err := s.ResetTLSMaterial(o.Name, &contextTLSData); err != nil { - return err - } - return nil + return s.ResetTLSMaterial(o.Name, &contextTLSData) } func checkContextNameForCreation(s store.Reader, name string) error {