File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ linters-settings:
102102 desc : do not use the ini package, use gitea's config system instead
103103 - pkg : gitea.com/go-chi/cache
104104 desc : do not use the go-chi cache package, use gitea's cache system
105+ usetesting :
106+ os-temp-dir : true
105107
106108issues :
107109 max-issues-per-linter : 0
Original file line number Diff line number Diff line change 44package storage
55
66import (
7- "os"
8- "path/filepath"
97 "testing"
108
119 "code.gitea.io/gitea/modules/setting"
@@ -56,6 +54,5 @@ func TestBuildLocalPath(t *testing.T) {
5654}
5755
5856func TestLocalStorageIterator (t * testing.T ) {
59- dir := filepath .Join (os .TempDir (), "TestLocalStorageIteratorTestDir" )
60- testStorageIterator (t , setting .LocalStorageType , & setting.Storage {Path : dir })
57+ testStorageIterator (t , setting .LocalStorageType , & setting.Storage {Path : t .TempDir ()})
6158}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import (
1717func TestCopyFile (t * testing.T ) {
1818 testContent := []byte ("hello" )
1919
20- tmpDir := os .TempDir ()
20+ tmpDir := t .TempDir ()
2121 now := time .Now ()
2222 srcFile := fmt .Sprintf ("%s/copy-test-%d-src.txt" , tmpDir , now .UnixMicro ())
2323 dstFile := fmt .Sprintf ("%s/copy-test-%d-dst.txt" , tmpDir , now .UnixMicro ())
You can’t perform that action at this time.
0 commit comments