Skip to content

Commit

Permalink
golangci-lint: enable early-return; fix one case (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Mar 24, 2024
1 parent 3f99346 commit 6182f8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions pkg/capabilities/triggers/mercury_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6182f8c

Please sign in to comment.