We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be36414 commit 0823d90Copy full SHA for 0823d90
internal/librariangen/generate/generator.go
@@ -248,16 +248,19 @@ func unzip(src, dest string) error {
248
249
rc, err := f.Open()
250
if err != nil {
251
+ outFile.Close()
252
return err
253
}
254
- _, err = io.Copy(outFile, rc)
255
+ _, copyErr := io.Copy(outFile, rc)
256
+ rc.Close() // Error on read-only file close is less critical
257
+ closeErr := outFile.Close()
258
- outFile.Close()
- rc.Close()
-
259
- if err != nil {
260
- return err
+ if copyErr != nil {
+ return copyErr
261
+ }
262
+ if closeErr != nil {
263
+ return closeErr
264
265
266
return nil
0 commit comments