From d845b4d36a145dc75e0d6b4890faafbde7a3c8f2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 13 Jan 2018 13:16:34 +0100 Subject: [PATCH] golint: remove redundant ifs Signed-off-by: Sebastiaan van Stijn --- cli/command/trust/sign.go | 5 +---- cli/command/trust/signer_remove.go | 5 +---- cmd/docker/docker.go | 7 +------ docs/yaml/yaml.go | 5 +---- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/cli/command/trust/sign.go b/cli/command/trust/sign.go index 2fc233da71..df5c088c9d 100644 --- a/cli/command/trust/sign.go +++ b/cli/command/trust/sign.go @@ -243,8 +243,5 @@ func addStagedSigner(notaryRepo client.Repository, newSigner data.RoleName, sign if err := notaryRepo.AddDelegationRoleAndKeys(trust.ReleasesRole, signerKeys); err != nil { return err } - if err := notaryRepo.AddDelegationPaths(trust.ReleasesRole, []string{""}); err != nil { - return err - } - return nil + return notaryRepo.AddDelegationPaths(trust.ReleasesRole, []string{""}) } diff --git a/cli/command/trust/signer_remove.go b/cli/command/trust/signer_remove.go index 6b35b3610e..4aa2825c4f 100644 --- a/cli/command/trust/signer_remove.go +++ b/cli/command/trust/signer_remove.go @@ -131,8 +131,5 @@ func removeSingleSigner(cli command.Cli, repoName, signerName string, forceYes b if err = notaryRepo.RemoveDelegationRole(signerDelegation); err != nil { return err } - if err = notaryRepo.Publish(); err != nil { - return err - } - return nil + return notaryRepo.Publish() } diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go index 3085990cc8..74d8447f7b 100644 --- a/cmd/docker/docker.go +++ b/cmd/docker/docker.go @@ -249,12 +249,7 @@ func isSupported(cmd *cobra.Command, details versionDetails) error { if err := areSubcommandsSupported(cmd, details); err != nil { return err } - - if err := areFlagsSupported(cmd, details); err != nil { - return err - } - - return nil + return areFlagsSupported(cmd, details) } func areFlagsSupported(cmd *cobra.Command, details versionDetails) error { diff --git a/docs/yaml/yaml.go b/docs/yaml/yaml.go index 8e42e25d8f..de32ea0328 100644 --- a/docs/yaml/yaml.go +++ b/docs/yaml/yaml.go @@ -79,10 +79,7 @@ func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string if _, err := io.WriteString(f, filePrepender(filename)); err != nil { return err } - if err := GenYamlCustom(cmd, f); err != nil { - return err - } - return nil + return GenYamlCustom(cmd, f) } // GenYamlCustom creates custom yaml output