From 1bb7eeebe7cae0b455477e590977c219783c6891 Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Fri, 3 Jan 2020 13:19:27 -0800 Subject: [PATCH] fixed inadvertent behavior change --- internal/fshasher/fshasher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/fshasher/fshasher.go b/internal/fshasher/fshasher.go index 712d068ec..2ee226bc3 100644 --- a/internal/fshasher/fshasher.go +++ b/internal/fshasher/fshasher.go @@ -114,10 +114,11 @@ func writeFile(ctx context.Context, w io.Writer, f fs.File) error { if err != nil { return err } + defer r.Close() //nolint:errcheck if _, err = io.Copy(w, r); err != nil { return err } - return r.Close() + return nil }