From e56681c35c226748793b1f9ab9e3ba16dc32c6db Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Tue, 1 Oct 2024 10:34:03 -0700 Subject: [PATCH] fix: actually store the error values in the deferred cleanup Signed-off-by: Kit Patella --- src/pkg/layout/split.go | 2 +- src/pkg/utils/auth.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/layout/split.go b/src/pkg/layout/split.go index 6afc82d398..fc0a6520e5 100644 --- a/src/pkg/layout/split.go +++ b/src/pkg/layout/split.go @@ -25,7 +25,7 @@ func splitFile(srcPath string, chunkSize int) (err error) { } defer func() { err2 := srcFile.Close() - errors.Join(err, err2) + err = errors.Join(err, err2) }() fi, err := srcFile.Stat() diff --git a/src/pkg/utils/auth.go b/src/pkg/utils/auth.go index 04e4a7302b..78b20a4a1a 100644 --- a/src/pkg/utils/auth.go +++ b/src/pkg/utils/auth.go @@ -65,7 +65,7 @@ func credentialParser(path string) (_ []Credential, err error) { } defer func() { err2 := file.Close() - errors.Join(err, err2) + err = errors.Join(err, err2) }() var credentials []Credential