mirror of
https://github.com/larksuite/cli.git
synced 2026-07-08 02:00:19 +08:00
fix(plugin): rename files to apps_ prefix and handle Close() errors (#1655)
- Rename plugin_install/list/uninstall .go files to apps_plugin_ prefix for consistency with other files in the package - Handle f.Close() errors in pluginExtractTGZ to avoid silent data loss
This commit is contained in:
@@ -373,10 +373,14 @@ func pluginExtractTGZ(r io.Reader, destDir string) error {
|
||||
return err
|
||||
}
|
||||
if _, err := io.Copy(f, tr); err != nil { //nolint:gosec // bounded by tar entry size
|
||||
f.Close()
|
||||
if cerr := f.Close(); cerr != nil {
|
||||
return fmt.Errorf("copy tar entry: %w; close file: %v", err, cerr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
f.Close()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user