From bb4b8b657beab1e588d7f5b86a458e5d55f8d715 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Tue, 1 Oct 2024 12:02:43 -0700 Subject: [PATCH] a/b testing... is it really two closes that fixes it? Signed-off-by: Kit Patella --- src/pkg/layout/split.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkg/layout/split.go b/src/pkg/layout/split.go index 16423a8a3a..9c2ee59506 100644 --- a/src/pkg/layout/split.go +++ b/src/pkg/layout/split.go @@ -45,10 +45,10 @@ func splitFile(srcPath string, chunkSize int) (err error) { if err != nil { return err } - // defer func(dstFile *os.File) { - // err2 := dstFile.Close() - // err = errors.Join(err, err2) - // }(dstFile) + defer func(dstFile *os.File) { + err2 := dstFile.Close() + err = errors.Join(err, err2) + }(dstFile) written, copyErr := io.CopyN(dstFile, srcFile, int64(chunkSize)) if copyErr != nil && !errors.Is(copyErr, io.EOF) { @@ -67,7 +67,7 @@ func splitFile(srcPath string, chunkSize int) (err error) { return err } - // Does inline close fix windows? + // FIXME(mkcp): Does inline close fix windows? err = dstFile.Close() if err != nil { return err