aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/tar.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-26 07:06:38 +0900
committerOphestra <cat@gensokyo.uk>2026-01-26 07:06:38 +0900
commit67d592c3374808bb06796af74636f01b094053dd (patch)
tree526c92666f2ace25837a3b89a329d3102fe05df1 /internal/pkg/tar.go
parentfdc8a8419bba468c5b97f8a89fceefcc23e9993a (diff)
internal/pkg: close gzip reader on success
The Close method panics otherwise. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/tar.go')
-rw-r--r--internal/pkg/tar.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/pkg/tar.go b/internal/pkg/tar.go
index 59c44cbf..c56176b1 100644
--- a/internal/pkg/tar.go
+++ b/internal/pkg/tar.go
@@ -97,12 +97,11 @@ func (a *tarArtifact) Cure(t *TContext) (err error) {
}
defer func(f io.ReadCloser) {
- closeErr := tr.Close()
if err == nil {
- err = closeErr
+ err = tr.Close()
}
- closeErr = f.Close()
+ closeErr := f.Close()
if err == nil {
err = closeErr
}