From e508993d934d76657305da7081c871149ba5c3be Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Tue, 2 Jul 2019 15:54:47 +0200 Subject: [PATCH] notification: fix linter errors Fix errors reported by default golangci-lint linters --- internal/services/notification/notification.go | 9 ++++----- internal/services/notification/runevents.go | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/services/notification/notification.go b/internal/services/notification/notification.go index 9834756..96697c9 100644 --- a/internal/services/notification/notification.go +++ b/internal/services/notification/notification.go @@ -68,9 +68,8 @@ func NewNotificationService(gc *config.Config) (*NotificationService, error) { func (n *NotificationService) Run(ctx context.Context) error { go n.runEventsHandlerLoop(ctx) - select { - case <-ctx.Done(): - log.Infof("notification service exiting") - return nil - } + <-ctx.Done() + log.Infof("notification service exiting") + + return nil } diff --git a/internal/services/notification/runevents.go b/internal/services/notification/runevents.go index 6fdf4b4..656b746 100644 --- a/internal/services/notification/runevents.go +++ b/internal/services/notification/runevents.go @@ -65,7 +65,7 @@ func (n *NotificationService) runEventsHandler(ctx context.Context) error { if err := m.Lock(ctx); err != nil { return err } - defer m.Unlock(ctx) + defer func() { _ = m.Unlock(ctx) }() resp, err := n.runserviceClient.GetRunEvents(ctx, "") if err != nil {