From 1a74f9792f4701d5d30a6f2282eb4e4a273ce411 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 18 Sep 2022 19:20:21 -0700 Subject: [PATCH] mkdir -p --- shared/testutils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/testutils.go b/shared/testutils.go index 8e8ad15..ebbb54f 100644 --- a/shared/testutils.go +++ b/shared/testutils.go @@ -9,6 +9,7 @@ import ( "os" "os/exec" "path" + "path/filepath" "runtime" "strings" "testing" @@ -83,6 +84,7 @@ func BackupAndRestoreWithId(t *testing.T, id string) func() { func touchFile(p string) { _, err := os.Stat(p) if os.IsNotExist(err) { + checkError(os.MkdirAll(filepath.Base(p), os.ModePerm)) file, err := os.Create(p) checkError(err) defer file.Close()