Skip to content

Commit

Permalink
#xxx - added file close
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-hajek committed Jul 10, 2020
1 parent ed4b4d8 commit f1596ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/service/storage/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func New(config Config) (*Handler, error) {
if err != nil {
return nil, err
}
defer f.Close()

bytes, err := ioutil.ReadAll(f)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions src/service/zipClient/test/zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func TestSymlink(t *testing.T) {

fo, err := r.File[0].Open()
Expect(err).ShouldNot(HaveOccurred())
defer fo.Close()
buf := new(bytes.Buffer)
_, err = io.Copy(buf, fo)
Expect(err).ShouldNot(HaveOccurred())
Expand Down

0 comments on commit f1596ee

Please sign in to comment.