From a99b50ecfa3235bfe188ef84c519663b44b6676a Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 8 May 2024 18:10:01 +0800 Subject: [PATCH] fix: close file Signed-off-by: guangwu --- drives/sync/filesystem.go | 1 + 1 file changed, 1 insertion(+) diff --git a/drives/sync/filesystem.go b/drives/sync/filesystem.go index 153f929c..b5d721b0 100644 --- a/drives/sync/filesystem.go +++ b/drives/sync/filesystem.go @@ -124,6 +124,7 @@ func (t *FilesystemTarget) WriteStream(path string, stream io.Reader, mode os.Fi if err != nil { return err } + defer f.Close() _, err = io.Copy(f, stream) if err != nil { return err