diff options
Diffstat (limited to 'routers/web/repo/settings_test.go')
-rw-r--r-- | routers/web/repo/settings_test.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/routers/web/repo/settings_test.go b/routers/web/repo/settings_test.go index 946220b4fc..4acd7df5b8 100644 --- a/routers/web/repo/settings_test.go +++ b/routers/web/repo/settings_test.go @@ -6,7 +6,6 @@ package repo import ( "net/http" - "os" "testing" "code.gitea.io/gitea/models" @@ -19,7 +18,6 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/test" - "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/services/forms" @@ -27,18 +25,13 @@ import ( ) func createSSHAuthorizedKeysTmpPath(t *testing.T) func() { - tmpDir, err := os.MkdirTemp("", "tmp-ssh") - if err != nil { - assert.Fail(t, "Unable to create temporary directory: %v", err) - return nil - } + tmpDir := t.TempDir() oldPath := setting.SSH.RootPath setting.SSH.RootPath = tmpDir return func() { setting.SSH.RootPath = oldPath - util.RemoveAll(tmpDir) } } |