syncthing/cmd
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
..
stcompdirs all: Remove crypto/md5 (#7493) 2021-03-17 22:22:49 +01:00
stcrashreceiver all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
stdisco all: Implement suture v4-api (#6947) 2020-11-17 13:19:04 +01:00
stdiscosrv cmd/stdiscosrv: Don't start replication listener without peers (fixes #8143) (#8144) 2022-01-27 09:36:54 +01:00
stevents cmd/stevents: Add command line argument for event type filtering. (#7226) 2020-12-22 22:10:26 +01:00
stfileinfo all: Implement variable sized blocks (fixes #4807) 2018-04-16 19:08:50 +01:00
stfinddevice lib: Removal global connection registry (#8254) 2022-04-09 16:04:56 +02:00
stfindignored all: Unused args, retvals, assignments (#7926) 2021-09-08 00:11:16 +02:00
stgenfiles all: Revert the underscore sillyness 2019-02-02 12:16:27 +01:00
strelaypoolsrv all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
strelaysrv all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
stsigtool all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
stupgrades cmd/stupgrades: Generate appropriate upgrade data (fixes #5924) (#5960) 2019-08-16 10:04:10 +02:00
stvanity all: Simplify some method calls (#7499) 2021-03-17 23:12:26 +01:00
stwatchfile all: Remove crypto/md5 (#7493) 2021-03-17 22:22:49 +01:00
syncthing all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
uraggregate cmd/uraggregate: Optimise queries (#7679) 2021-05-16 12:34:46 +01:00
ursrv all: Remove usage of deprecated io/ioutil (#7971) 2021-11-22 08:59:47 +01:00
.gitignore Remove reprecated st* utils 2014-07-01 12:20:25 +02:00