diff --git a/.golangci.yml b/.golangci.yml index 874235076..4300d9b74 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -73,7 +73,7 @@ linters-settings: - name: identical-branches - name: get-return # - name: flag-parameter - # - name: early-return + - name: early-return - name: defer - name: constant-logical-expr # - name: confusing-naming diff --git a/pkg/capabilities/triggers/mercury_trigger.go b/pkg/capabilities/triggers/mercury_trigger.go index 7c5f2ad1c..5e2e23b69 100644 --- a/pkg/capabilities/triggers/mercury_trigger.go +++ b/pkg/capabilities/triggers/mercury_trigger.go @@ -86,11 +86,10 @@ func (o *MercuryTriggerService) ProcessReport(reports []mercury.FeedReport) erro } ch, ok := o.chans[triggerID] - if ok { - ch <- capabilityResponse - } else { + if !ok { return fmt.Errorf("no registration for %s", triggerID) } + ch <- capabilityResponse } return nil }