bsc/node
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
..
api_test.go internal/web3ext, node: migrate node admin API (Start|Stop)RPC->HTTP (#22461) 2021-03-23 11:41:23 +02:00
api.go cmd/geth, node, rpc: implement jwt tokens (#24364) 2022-03-07 09:30:27 +02:00
config_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
config.go core: eth: implement Kiln-v2 spec (#24506) 2022-03-17 17:20:03 +02:00
defaults.go core: eth: implement Kiln-v2 spec (#24506) 2022-03-17 17:20:03 +02:00
doc.go node: refactor package node (#21105) 2020-08-03 19:40:46 +02:00
endpoints.go cmd/geth, node, rpc: implement jwt tokens (#24364) 2022-03-07 09:30:27 +02:00
errors.go node: refactor package node (#21105) 2020-08-03 19:40:46 +02:00
jwt_handler.go cmd/geth, node, rpc: implement jwt tokens (#24364) 2022-03-07 09:30:27 +02:00
lifecycle.go node: refactor package node (#21105) 2020-08-03 19:40:46 +02:00
node_example_test.go node: refactor package node (#21105) 2020-08-03 19:40:46 +02:00
node_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
node.go node: allow JWT pass by file only (#24579) 2022-03-24 15:04:47 +01:00
rpcstack_test.go cmd/geth, node, rpc: implement jwt tokens (#24364) 2022-03-07 09:30:27 +02:00
rpcstack.go cmd/geth, node, rpc: implement jwt tokens (#24364) 2022-03-07 09:30:27 +02:00
utils_test.go all: remove unneeded parentheses (#21921) 2021-02-02 11:32:44 +02:00