As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit 0c12d7e5 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Prefer t.TempDir() over os.MkdirTemp()

parent b7106f34
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -28,10 +28,7 @@ func TempEnv(env map[string]string) func() {
func PrepareTestRootDir(t *testing.T) string {
t.Helper()
testRoot, err := os.MkdirTemp("", "root")
require.NoError(t, err)
require.NoError(t, os.MkdirAll(testRoot, 0700))
testRoot := t.TempDir()
t.Cleanup(func() { require.NoError(t, os.RemoveAll(testRoot)) })
require.NoError(t, copyTestData(testRoot))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment