From 26661912bbeb0969e5ea869685399cd076f7458c Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 10 Apr 2024 13:24:16 +0800 Subject: [PATCH] fix: close pluginFile --- pkg/plugins/install.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/plugins/install.go b/pkg/plugins/install.go index 75ef4d5a4..4e9b40e71 100644 --- a/pkg/plugins/install.go +++ b/pkg/plugins/install.go @@ -120,6 +120,7 @@ func (i Installer) writePluginFiles(dstPath string, plugin metadata.Plugin) erro if err != nil { return errors.Wrapf(err, "create plugin file %s", f.Path) } + defer writer.Close() reader := strings.NewReader(f.Content) if _, err := io.Copy(writer, reader); err != nil { return errors.Wrapf(err, "write plugin file %s", f.Path)