Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Log error of response body closing
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrem committed Aug 14, 2019
1 parent cc287e9 commit 8bad2d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ func (e *Exporter) fetch(uri string) ([]byte, error) {
e.up.Set(0)
return nil, err
}
defer resp.Body.Close()
defer func() {
if err := resp.Body.Close(); err != nil {
log.Errorln(err)
}
}()

e.up.Set(1)

Expand Down

0 comments on commit 8bad2d6

Please sign in to comment.