go-ethereum/p2p
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
..
discover all: fix 'the the' in comments (#24036) 2021-12-02 15:42:09 +01:00
dnsdisc p2p/dnsdisc: fix crash when iterator closed before first call to Next (#22906) 2021-05-20 09:24:41 +02:00
enode all: use T.TempDir to create temporary test directories (#24633) 2022-04-08 15:44:55 +02:00
enr p2p/enr: reduce allocation in Record.encode (#24034) 2021-12-02 10:55:01 +01:00
msgrate p2p/msgrate: return capacity as integer, clamp to max uint32 (#22943) 2021-05-27 19:43:55 +03:00
nat p2p/nat: skip TestUPNP in non-CI environments if discover fails (#22877) 2021-05-25 22:37:30 +02:00
netutil all: add go:build lines (#23468) 2021-08-25 18:46:29 +02:00
nodestate les/vflux/client, p2p/nodestate: fix data races (#24058) 2021-12-14 11:34:50 +01:00
rlpx p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
simulations core/types: faster RLP encoding of Header, StateAcccount, ReceiptForStorage (#24420) 2022-02-18 08:10:26 +01:00
tracker p2p/tracker: only reschedule wake if previous didn't run 2021-04-27 21:47:59 +03:00
dial_test.go p2p: new dial scheduler (#20592) 2020-02-13 11:10:03 +01:00
dial.go p2p, p2p/enode: fix data races (#23434) 2021-08-24 12:22:56 +02:00
message_test.go p2p: move rlpx into separate package (#21464) 2020-09-22 10:17:39 +02:00
message.go eth: implement eth66 (#22241) 2021-02-18 18:54:29 +02:00
metrics.go eth/protocols, prp/tracker: add support for req/rep rtt tracking (#22608) 2021-04-22 11:42:46 +03:00
peer_error.go p2p: define DiscReason as uint8 (#24507) 2022-03-07 18:25:45 +01:00
peer_test.go p2p: move rlpx into separate package (#21464) 2020-09-22 10:17:39 +02:00
peer.go p2p: define DiscReason as uint8 (#24507) 2022-03-07 18:25:45 +01:00
protocol.go cmd/devp2p, p2p: dial using node iterator, discovery crawler (#20132) 2019-10-29 17:08:57 +02:00
server_test.go all: fix warning flagging the use of DeepEqual on error (#23624) 2021-10-19 17:06:47 +02:00
server.go p2p: reduce the scope of variable dialPubkey (#24385) 2022-02-14 12:05:48 +01:00
transport_test.go p2p: move rlpx into separate package (#21464) 2020-09-22 10:17:39 +02:00
transport.go p2p/rlpx: reduce allocation and syscalls (#22899) 2021-05-27 10:19:13 +02:00
util_test.go p2p: new dial scheduler (#20592) 2020-02-13 11:10:03 +01:00
util.go p2p: new dial scheduler (#20592) 2020-02-13 11:10:03 +01:00