Skip to content

Commit

Permalink
fix: actually store the error values in the deferred cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Oct 1, 2024
1 parent 910027f commit e56681c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pkg/layout/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/utils/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e56681c

Please sign in to comment.