mirror of
https://github.com/golang/go
synced 2024-11-22 01:24:42 -07:00
archive/zip: actually close file opened with OpenReader.
R=golang-dev, adg CC=golang-dev https://golang.org/cl/5341044
This commit is contained in:
parent
75af79b9b5
commit
ad0e8b31d8
@ -60,6 +60,7 @@ func OpenReader(name string) (*ReadCloser, error) {
|
|||||||
f.Close()
|
f.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
r.f = f
|
||||||
return r, nil
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,11 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
|||||||
if err == FormatError {
|
if err == FormatError {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer z.Close()
|
defer func() {
|
||||||
|
if err := z.Close(); err != nil {
|
||||||
|
t.Errorf("error %q when closing zip file", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// bail here if no Files expected to be tested
|
// bail here if no Files expected to be tested
|
||||||
// (there may actually be files in the zip, but we don't care)
|
// (there may actually be files in the zip, but we don't care)
|
||||||
|
Loading…
Reference in New Issue
Block a user