mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
motivate the explicit f.Close()
This commit is contained in:
parent
b597b16173
commit
93c18a7d4d
1 changed files with 4 additions and 0 deletions
|
|
@ -141,6 +141,10 @@ func gzipUntar(dst string, r io.Reader, subDir string) error {
|
||||||
if _, err := io.Copy(f, tr); err != nil {
|
if _, err := io.Copy(f, tr); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Explicitly release the file handle inside the inner loop
|
||||||
|
// Using defer would accumulate an unbounded quantity of
|
||||||
|
// handles and release them all at once at function end.
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue