Merge pull request #3023 from chengzhichao-xydt/codex/updater-close-errors
fix: check Close() errors in updater extraction functions
This commit is contained in:
commit
ebf17aa152
1 changed files with 10 additions and 3 deletions
|
|
@ -584,8 +584,13 @@ func extractZip(archivePath, destDir string) error {
|
||||||
out.Close()
|
out.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
rc.Close()
|
if err := rc.Close(); err != nil {
|
||||||
out.Close()
|
out.Close()
|
||||||
|
return fmt.Errorf("close zip entry reader: %w", err)
|
||||||
|
}
|
||||||
|
if err := out.Close(); err != nil {
|
||||||
|
return fmt.Errorf("close extracted file %q: %w", target, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -649,7 +654,9 @@ func extractTarFromReader(tr *tar.Reader, destDir string) error {
|
||||||
out.Close()
|
out.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
out.Close()
|
if err := out.Close(); err != nil {
|
||||||
|
return fmt.Errorf("close extracted file %q: %w", target, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue