Skip to content

Commit

Permalink
webhook: fix a code smell
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Nov 11, 2021
1 parent 3399a75 commit 7334521
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions notifier/webhook/deliverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@ func (d *Deliverer) Deliver(ctx context.Context, nID uuid.UUID) error {
Msg("dispatching webhook")

resp, err := d.c.Do(req)
if resp != nil {
defer resp.Body.Close()
}
if err != nil {
return &clairerror.ErrDeliveryFailed{E: err}
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return &clairerror.ErrDeliveryFailed{
E: &clairerror.ErrRequestFail{
Expand Down

0 comments on commit 7334521

Please sign in to comment.