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:
anngo-nk
2026-06-30 11:07:14 +08:00
committed by GitHub
parent 9f2fe50f4a
commit ff65e614e7
7 changed files with 6 additions and 2 deletions

View File

@@ -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