We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21a7dfe commit 028a85dCopy full SHA for 028a85d
controllers/storage_test.go
@@ -317,15 +317,11 @@ func TestStorageCopyFromPath(t *testing.T) {
317
}
318
319
createFile := func(file *File) (absPath string, err error) {
320
- defer func() {
321
- if err != nil && dir != "" {
322
- os.RemoveAll(dir)
323
- }
324
- }()
325
dir, err = os.MkdirTemp("", "test-files-")
326
if err != nil {
327
return
328
+ t.Cleanup(cleanupStoragePath(dir))
329
absPath = filepath.Join(dir, file.Name)
330
if err = os.MkdirAll(filepath.Dir(absPath), 0755); err != nil {
331
0 commit comments