From 2e637641ca3ae2332d2299efd5559a93aeb2b1f1 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Wed, 2 Oct 2024 10:35:58 +0200 Subject: [PATCH] close object file Signed-off-by: Pablo Chacin --- pkg/cache/file/file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cache/file/file.go b/pkg/cache/file/file.go index e7cefed..fc3374c 100644 --- a/pkg/cache/file/file.go +++ b/pkg/cache/file/file.go @@ -66,6 +66,7 @@ func (f *Cache) Store(_ context.Context, id string, content io.Reader) (cache.Ob if err != nil { return cache.Object{}, fmt.Errorf("%w: %w", cache.ErrCreatingObject, err) } + defer objectFile.Close() //nolint:errcheck // write content to object file and copy to buffer to calculate checksum // TODO: optimize memory by copying content in blocks