syncthing/lib/fs
Eng Zer Jun bc27aa12cd
all: use T.TempDir to create temporary test directory (#8280)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-15 07:44:06 +04:00
..
basicfs.go
basicfs_copy_range.go
basicfs_copy_range_copyfilerange.go
basicfs_copy_range_duplicateextents.go
basicfs_copy_range_ioctl.go
basicfs_copy_range_sendfile.go
basicfs_fileinfo_unix.go
basicfs_fileinfo_windows.go
basicfs_lstat_broken.go
basicfs_lstat_regular.go
basicfs_lstat_windows.go
basicfs_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
basicfs_unix.go
basicfs_watch.go
basicfs_watch_errors_linux.go
basicfs_watch_errors_others.go
basicfs_watch_eventtypes_darwin.go
basicfs_watch_eventtypes_fen.go
basicfs_watch_eventtypes_inotify.go
basicfs_watch_eventtypes_kqueue.go
basicfs_watch_eventtypes_other.go
basicfs_watch_eventtypes_readdcw.go
basicfs_watch_notkqueue.go
basicfs_watch_test.go
basicfs_watch_unsupported.go
basicfs_windows.go
basicfs_windows_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
casefs.go
casefs_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
copyrangemethod.go
copyrangemethod.pb.go
debug.go
debug_symlink_unix.go
debug_symlink_windows.go
errorfs.go
fakefs.go
fakefs_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
filesystem.go
filesystem_copy_range.go
filesystem_copy_range_allwithfallback.go
filesystem_copy_range_standard.go
filesystem_copy_range_test.go
filesystem_test.go
folding.go
folding_test.go
logfs.go
mtimefs.go
mtimefs_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
tempname.go
tempname_test.go
types.go
types.pb.go
util.go
util_test.go
walkfs.go
walkfs_test.go