From 60ae8042cb5d931b93d7500c780d7b5b4467162b Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Fri, 5 May 2023 07:04:20 -0500 Subject: [PATCH] Fix if-return, unused-parameter linting errors Fix various revive linting errors surfaced by the latest linter release. --- cmd/check_imap_mailbox_basic/process.go | 2 +- internal/config/logging.go | 7 +------ internal/config/validate.go | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmd/check_imap_mailbox_basic/process.go b/cmd/check_imap_mailbox_basic/process.go index 1ec9fbfd..70806fb8 100644 --- a/cmd/check_imap_mailbox_basic/process.go +++ b/cmd/check_imap_mailbox_basic/process.go @@ -18,7 +18,7 @@ import ( ) func processAccount( - ctx context.Context, + _ context.Context, account config.MailAccount, cfg *config.Config, state *nagios.Plugin, diff --git a/internal/config/logging.go b/internal/config/logging.go index b8677f5c..982a7dfc 100644 --- a/internal/config/logging.go +++ b/internal/config/logging.go @@ -201,10 +201,5 @@ func (c *Config) setupLogging(appType AppType) error { } - if err := setLoggingLevel(c.LoggingLevel); err != nil { - return err - } - - return nil - + return setLoggingLevel(c.LoggingLevel) } diff --git a/internal/config/validate.go b/internal/config/validate.go index 3ee141e7..b9b3bb03 100644 --- a/internal/config/validate.go +++ b/internal/config/validate.go @@ -56,7 +56,7 @@ func validateLoggingLevels(c Config) error { // validateAccountBasicAuthFields is responsible for validating MailAccount // fields specific to the Basic Authentication type. The caller is responsible // for calling this function for the appropriate application type. -func validateAccountBasicAuthFields(account MailAccount, appType AppType) error { +func validateAccountBasicAuthFields(account MailAccount, _ AppType) error { if account.Username == "" { return fmt.Errorf("username not provided for account %s", account.Name, @@ -76,7 +76,7 @@ func validateAccountBasicAuthFields(account MailAccount, appType AppType) error // MailAccount fields specific to the OAuth2 Client Credentials Flow // authentication type. The caller is responsible for calling this function // for the appropriate application type. -func validateAccountOAuth2ClientCredsAuthFields(account MailAccount, appType AppType) error { +func validateAccountOAuth2ClientCredsAuthFields(account MailAccount, _ AppType) error { if account.OAuth2Settings.ClientID == "" { return fmt.Errorf("client ID not provided for account %s", account.Name,