Skip to content

Commit

Permalink
fixes try to clode Body even if error is not nil
Browse files Browse the repository at this point in the history
fixes: #3
  • Loading branch information
xsteadfastx committed Apr 15, 2020
1 parent bac054f commit 6f20bf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jitsiexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
case r := <-res:
err = r.Error
resp = r.Resp

defer resp.Body.Close()
}

if err != nil {
Expand All @@ -148,6 +146,8 @@ func (c colibri) Now(url string) (map[string]interface{}, error) {
return nil, err
}

defer resp.Body.Close()

return s, nil
}

Expand Down

0 comments on commit 6f20bf1

Please sign in to comment.