From 5b8f962c242caec18ae5642c1899cc635b89d152 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 8 Aug 2023 07:53:21 +0200 Subject: [PATCH] filesync: write closer err discarded Signed-off-by: CrazyMax --- session/filesync/filesync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session/filesync/filesync.go b/session/filesync/filesync.go index a51b490857f1..05e089340a9f 100644 --- a/session/filesync/filesync.go +++ b/session/filesync/filesync.go @@ -277,7 +277,7 @@ func (sp *fsSyncTarget) DiffCopy(stream FileSend_DiffCopyServer) (err error) { } defer func() { err1 := wc.Close() - if err != nil { + if err == nil { err = err1 } }()