kubo/repo
Eng Zer Jun 7f7a5ab1b9 test: use T.TempDir to create temporary test directory
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>
2023-03-13 10:29:36 -04:00
..
common refactor: rename to kubo 2022-07-06 18:40:37 +02:00
fsrepo test: use T.TempDir to create temporary test directory 2023-03-13 10:29:36 -04:00
mock.go feat: Reduce RM code footprint 2023-03-06 12:46:58 +01:00
onlyone.go fmt: applies go1.19 fmt 2022-09-08 18:34:06 +02:00
repo.go feat: Reduce RM code footprint 2023-03-06 12:46:58 +01:00