From 460d6cce367a020a0c6a7b26e654cedec3d0c4fa Mon Sep 17 00:00:00 2001 From: Christoph Loy Date: Thu, 18 Jan 2024 18:46:30 +0100 Subject: [PATCH] Properly close created files --- internal/config/generator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/config/generator.go b/internal/config/generator.go index 4ed1ac5f..9490cfcb 100644 --- a/internal/config/generator.go +++ b/internal/config/generator.go @@ -858,7 +858,8 @@ func create(file string) error { return err } } - _, err := os.Create(file) + f, err := os.Create(file) + defer func() { _ = f.Close() }() return err }