Skip to content

Commit

Permalink
Merge pull request #120 from go-spectest/fix/response-body-close
Browse files Browse the repository at this point in the history
Fix: image.EqualFromFile() close response body.
  • Loading branch information
nao1215 authored Oct 25, 2023
2 parents a0814e5 + e4ec0c0 commit c9171a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [0.0.8, unreleased] - 2023-xx-xx
## [0.0.9] - 2023-XX-XX
### Fixed
- image.EqualFromFile() close response body.

## [0.0.8] - 2023-10-24
### Added
- image package
- Support image comparison; EqualFromFile()
Expand Down
2 changes: 2 additions & 0 deletions image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func EqualFromFile(expected string) func(*http.Response, *http.Request) error {
if err != nil {
return err
}
defer res.Body.Close() //nolint:errcheck

if _, err = tempFile.Write(body); err != nil {
return err
}
Expand Down

0 comments on commit c9171a8

Please sign in to comment.