go-ethereum/cmd/geth
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 cmd/geth: update vulnerability testdata (#23252) 2021-07-27 16:19:48 +02:00
accountcmd.go node: remove dependency on wallet backend packages (#23019) 2021-08-25 22:34:22 +02:00
accountcmd_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
chaincmd.go cmd/geth: add support for sepolia testnet (#23730) 2021-11-08 13:06:01 +02:00
config.go cmd/geth: change to non-fatal error message when legacy receipt storage is not implemented (#24603) 2022-03-29 10:40:42 +02:00
consolecmd.go cmd/geth, console: support interrupting the js console (#23387) 2021-12-11 16:51:05 +01:00
consolecmd_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
dao_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
dbcmd.go eth/catalyst: only apply block if we actually have the state (#24598) 2022-03-29 18:26:18 +02:00
genesis_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
les_test.go cmd/geth: fix IPC probe in les test (#23094) 2021-06-25 12:40:37 +02:00
main.go core, params: add kiln flag (#24548) 2022-03-17 17:34:22 +02:00
misccmd.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
run_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
snapshot.go cmd/geth: inspect snapshot dangling storage (#24643) 2022-04-08 15:08:46 +02:00
usage.go core, params: add kiln flag (#24548) 2022-03-17 17:34:22 +02:00
version_check.go cmd/geth: implement vulnerability check (#21859) 2020-12-04 15:01:47 +01:00
version_check_test.go cmd/geth: add tests for version_check (#24169) 2022-01-11 10:39:04 +01:00