Skip to content

Commit

Permalink
close even if readall fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Apr 19, 2015
1 parent 779f79c commit e098b9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ func newFile(zf *zip.File, isDir bool) (*file, error) {
if err != nil {
return nil, err
}
defer rc.Close()
all, err := ioutil.ReadAll(rc)
if err != nil {
return nil, err
}
rc.Close()

return &file{
FileInfo: zf.FileInfo(),
data: all,
Expand Down

0 comments on commit e098b9d

Please sign in to comment.