From 1f02c2177b0ef86301ceb534ae4388fef63809b5 Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 3 Sep 2024 11:37:29 +0200 Subject: [PATCH] Use t.Tempdir Signed-off-by: Julien --- config/reload_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/reload_test.go b/config/reload_test.go index 0d8630911..f0f44f358 100644 --- a/config/reload_test.go +++ b/config/reload_test.go @@ -22,10 +22,7 @@ import ( ) func TestGenerateChecksum(t *testing.T) { - // Create a temporary directory to hold the test files. - tmpDir, err := os.MkdirTemp("", "checksum_test") - require.NoError(t, err) - defer os.RemoveAll(tmpDir) // Clean up. + tmpDir := t.TempDir() // Define paths for the temporary files. yamlFilePath := filepath.Join(tmpDir, "test.yml")