go-ethereum/p2p/enode
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
..
idscheme.go vendor, crypto, swarm: switch over to upstream sha3 package 2019-01-04 09:26:07 +02:00
idscheme_test.go all: new p2p node representation (#17643) 2018-09-25 00:59:00 +02:00
iter.go p2p/enode: remove data race in sliceIter (#20421) 2019-12-05 22:16:35 +01:00
iter_test.go p2p, p2p/enode: fix data races (#23434) 2021-08-24 12:22:56 +02:00
localnode.go p2p/enode: store local port number as uint16 (#23926) 2021-11-23 15:14:08 +01:00
localnode_test.go p2p/enode: use unix timestamp as base ENR sequence number (#19903) 2021-09-07 12:36:48 +02:00
node.go p2p/enode: fix method doc (#23115) 2021-06-28 10:48:17 +03:00
node_test.go p2p/enode: improve IPv6 support, add ENR text representation (#19663) 2019-06-07 15:31:00 +02:00
nodedb.go p2p/enode: use unix timestamp as base ENR sequence number (#19903) 2021-09-07 12:36:48 +02:00
nodedb_test.go all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
urlv4.go p2p/enode: update code comment (#20972) 2020-04-24 16:50:03 +02:00
urlv4_test.go p2p/enode: mock DNS resolver in URL parsing test (#20252) 2019-11-07 16:40:37 +01:00