From d9666b73b47b5c39b5ee497e1d75a6f4eb038523 Mon Sep 17 00:00:00 2001 From: David Dymko Date: Thu, 19 Nov 2020 13:12:21 -0500 Subject: [PATCH] sshkey + firewall rule linted --- firewall_rule.go | 8 ++------ ssh_key.go | 12 ++---------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/firewall_rule.go b/firewall_rule.go index d50bd87..f35981f 100644 --- a/firewall_rule.go +++ b/firewall_rule.go @@ -34,7 +34,7 @@ type FirewallRule struct { Notes string `json:"notes"` } -// FirewallRuleReq +// FirewallRuleReq struct used to create a FirewallRule. type FirewallRuleReq struct { IPType string `json:"ip_type"` Protocol string `json:"protocol"` @@ -97,11 +97,7 @@ func (f *FireWallRuleServiceHandler) Delete(ctx context.Context, fwGroupID strin return err } - if err = f.client.DoWithContext(ctx, req, nil); err != nil { - return err - } - - return nil + return f.client.DoWithContext(ctx, req, nil) } // List will return both ipv4 an ipv6 firewall rules that are defined within a firewall group diff --git a/ssh_key.go b/ssh_key.go index 71ba784..c649ce6 100644 --- a/ssh_key.go +++ b/ssh_key.go @@ -88,11 +88,7 @@ func (s *SSHKeyServiceHandler) Update(ctx context.Context, sshKeyID string, sshK return err } - if err = s.client.DoWithContext(ctx, req, nil); err != nil { - return err - } - - return nil + return s.client.DoWithContext(ctx, req, nil) } // Delete a specific ssh-key. @@ -104,11 +100,7 @@ func (s *SSHKeyServiceHandler) Delete(ctx context.Context, sshKeyID string) erro return err } - if err = s.client.DoWithContext(ctx, req, nil); err != nil { - return err - } - - return nil + return s.client.DoWithContext(ctx, req, nil) } // List all available SSH Keys.