diff --git a/.golangci.yml b/.golangci.yml index 44dcb969d67..9fe5e6782fd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,7 @@ linters: - revive - staticcheck - unused + - usetesting - whitespace settings: depguard: @@ -119,6 +120,8 @@ linters: - -ST1000 - -ST1001 # duplicates revive.dot-imports - -ST1022 + usetesting: + os-temp-dir: true exclusions: presets: - common-false-positives diff --git a/pkg/limayaml/defaults_test.go b/pkg/limayaml/defaults_test.go index b8f203838dd..9b08ed43b1f 100644 --- a/pkg/limayaml/defaults_test.go +++ b/pkg/limayaml/defaults_test.go @@ -148,7 +148,7 @@ func TestFillDefault(t *testing.T) { Mounts: []Mount{ // Location will be passed through localpathutil.Expand() which will normalize the name // (add a drive letter). So we must start with a valid local path to match it again later. - {Location: filepath.Clean(os.TempDir())}, + {Location: filepath.Clean(t.TempDir())}, {Location: "{{.Dir}}/{{.Param.ONE}}", MountPoint: ptr.Of("/mnt/{{.Param.ONE}}")}, }, MountType: ptr.Of(NINEP),