mirror of
https://github.com/restic/restic.git
synced 2025-12-04 00:41:47 +00:00
test: Use testing.T.Cleanup to remove tempdirs
This commit is contained in:
@@ -14,8 +14,7 @@ import (
|
||||
func TestPreallocate(t *testing.T) {
|
||||
for _, i := range []int64{0, 1, 4096, 1024 * 1024} {
|
||||
t.Run(strconv.FormatInt(i, 10), func(t *testing.T) {
|
||||
dirpath, cleanup := test.TempDir(t)
|
||||
defer cleanup()
|
||||
dirpath := test.TempDir(t)
|
||||
|
||||
flags := os.O_CREATE | os.O_TRUNC | os.O_WRONLY
|
||||
wr, err := os.OpenFile(path.Join(dirpath, "test"), flags, 0600)
|
||||
|
||||
Reference in New Issue
Block a user