plugeth/accounts/keystore
Eng Zer Jun 8d066f1f42
all: use T.TempDir to create temporary test directories (#24633)
This commit replaces ioutil.TempDir 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 ioutil.TempDir
had 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-08 15:44:55 +02:00
..
testdata all: replace passPHRASE with passWORD in user interactions (#19932) 2019-08-12 12:00:38 +03:00
account_cache_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
account_cache.go all: remove unneeded parentheses (#21921) 2021-02-02 11:32:44 +02:00
file_cache.go all: replace RWMutex with Mutex in places where RLock is not used (#21622) 2020-10-13 10:58:41 +02:00
key.go accounts/keystore: use github.com/google/uuid (#22217) 2021-02-26 15:28:34 +01:00
keystore_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
keystore.go all: add support for EIP-2718, EIP-2930 transactions (#21502) 2021-02-25 15:26:57 +01:00
passphrase_test.go accounts/keystore: delete the redundant keystore in filename (#17930) 2018-11-29 12:04:56 +02:00
passphrase.go accounts/keystore: use github.com/google/uuid (#22217) 2021-02-26 15:28:34 +01:00
plain_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
plain.go accounts/keystore: delete the redundant keystore in filename (#17930) 2018-11-29 12:04:56 +02:00
presale.go accounts/keystore: use github.com/google/uuid (#22217) 2021-02-26 15:28:34 +01:00
wallet.go accounts/keystore: add missing function doc for SignText (#21914) 2020-11-30 09:03:24 +01:00
watch_fallback.go all: add go:build lines (#23468) 2021-08-25 18:46:29 +02:00
watch.go all: add go:build lines (#23468) 2021-08-25 18:46:29 +02:00