Eng Zer Jun
49c5eba458
test: use T.TempDir to create temporary test directory ( #2671 )
...
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 >
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com >
2022-11-13 14:13:29 -06:00
..
2022-10-27 20:04:06 -05:00
2022-05-13 10:19:29 -07:00
2022-11-07 14:50:49 -06:00
2022-11-12 22:45:19 -06:00
2022-11-11 09:56:33 -06:00
2021-12-30 09:52:52 -05:00
2022-09-30 13:36:53 -07:00
2022-11-04 09:22:55 -07:00
2022-11-12 20:32:19 -06:00
2022-03-21 10:36:13 -07:00
2022-09-08 06:14:59 -07:00
2022-03-21 10:36:13 -07:00
2022-03-21 10:36:13 -07:00
2022-03-21 10:36:13 -07:00
2022-03-21 10:36:13 -07:00
2022-11-13 14:13:29 -06:00
2022-11-07 14:50:49 -06:00
2019-02-26 12:03:25 -05:00
2022-06-22 11:34:12 -07:00
2022-09-12 18:08:46 -07:00
2022-03-21 10:36:13 -07:00
2022-03-21 10:36:13 -07:00
2022-09-07 16:57:06 -07:00
2022-11-13 14:13:29 -06:00
2022-09-07 16:57:06 -07:00
2020-05-25 15:03:08 -07:00
2020-05-25 15:09:51 -07:00
2022-09-08 13:45:00 -04:00
2022-10-10 21:13:24 -07:00
2022-11-13 14:13:29 -06:00
2021-10-07 00:37:42 -04:00
2022-11-13 14:13:29 -06:00
2022-05-13 10:19:29 -07:00
2022-03-21 10:36:13 -07:00
2022-03-21 10:36:13 -07:00
2022-09-20 21:27:30 -07:00
2022-11-13 14:13:29 -06:00
2022-11-12 22:45:19 -06:00
2022-05-13 10:19:29 -07:00
2022-11-13 14:13:29 -06:00
2022-05-13 10:19:29 -07:00
2022-10-25 17:28:34 -04:00
2022-10-26 23:35:49 -07:00
2022-11-07 14:50:49 -06:00
2022-11-07 14:50:49 -06:00
2022-11-07 14:50:49 -06:00
2022-11-07 14:50:49 -06:00
2022-11-13 14:13:29 -06:00
2022-11-13 14:13:29 -06:00
2022-11-08 22:08:20 -08:00
2022-03-21 10:36:13 -07:00
2022-06-29 12:01:54 -07:00
2022-09-08 06:14:59 -07:00
2022-11-13 14:13:29 -06:00
2022-06-22 09:29:41 -07:00
2022-11-13 14:13:29 -06:00
2022-09-30 13:36:53 -07:00
2021-07-01 12:54:44 -07:00
2021-07-01 12:54:44 -07:00
2022-11-13 14:13:29 -06:00
2022-09-07 16:57:06 -07:00
2021-04-13 12:46:47 -07:00
2022-03-21 10:36:13 -07:00
2020-07-25 23:50:09 -07:00
2020-07-25 23:50:09 -07:00
2022-11-13 14:13:29 -06:00
2022-01-04 11:20:29 -08:00
2022-01-04 11:20:29 -08:00
2022-03-21 10:36:13 -07:00
2022-07-07 10:32:18 -07:00
2022-07-07 10:32:18 -07:00
2022-03-21 10:36:13 -07:00
2022-03-22 15:05:00 -07:00
2022-03-21 16:08:52 -07:00
2022-11-13 14:13:29 -06:00
2022-09-12 18:08:46 -07:00