status-go/account
Eng Zer Jun 83ad76637a
test: use `T.TempDir` to create temporary test directory (#2746)
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-04-26 21:39:51 +01:00
..
generator feat: create acc from private key endpoint added 2023-03-28 16:19:27 +02:00
json Refactored BasePayloadReceiver to handle Receive() 2023-04-04 11:56:40 +01:00
accounts.go fix(accounts): fix windows path on re-encryption (#3412) 2023-04-20 16:57:16 -04:00
accounts_geth.go Add methods to sign and recover messages/signatures to AccountManager 2023-03-16 12:25:06 +01:00
accounts_test.go test: use `T.TempDir` to create temporary test directory (#2746) 2023-04-26 21:39:51 +01:00
address.go Migrate more files to eth-node/crypto 2019-12-20 11:24:26 +01:00
address_test.go Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
keystore_geth.go replace deprecated ioutil.TempDir with os.MkdirTemp 2023-01-03 15:40:11 +01:00
onboarding.go Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
onboarding_test.go add multi-account support (#1500) 2019-07-24 20:59:15 +02:00
utils.go Fix tests and lint 2020-12-17 14:10:00 +01:00
utils_test.go Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00