From b92dacdab4c014ec0e76841266ef626e602871b9 Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Sat, 2 Nov 2024 09:38:38 +0200 Subject: [PATCH] Fix minor cleanup bug in non existent runtime directory test case --- xdg_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdg_test.go b/xdg_test.go index 47b1392..b3dd233 100644 --- a/xdg_test.go +++ b/xdg_test.go @@ -216,12 +216,12 @@ func TestNonExistentRuntimeDir(t *testing.T) { for _, runtimeFile := range runtimeFiles { suggestedPath, err := xdg.RuntimeFile(runtimeFile) require.NoError(t, err) - require.Equal(t, true, strings.HasPrefix(suggestedPath, os.TempDir())) + require.True(t, strings.HasPrefix(suggestedPath, os.TempDir())) f, err := os.Create(suggestedPath) require.NoError(t, err) - require.NoError(t, f.Close()) defer os.Remove(suggestedPath) + require.NoError(t, f.Close()) foundPath, err := xdg.SearchRuntimeFile(runtimeFile) require.NoError(t, err)