From 218f33bc62e8e8fd8d7fa73ba8d93c60dd188a7c Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 29 Apr 2021 21:35:37 +0000 Subject: [PATCH] run gofmt -s --- config/muxer_test.go | 6 +++--- p2p/host/basic/basic_host_test.go | 8 ++++---- p2p/host/basic/natmgr.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/muxer_test.go b/config/muxer_test.go index 6fe5aa2c..0a860920 100644 --- a/config/muxer_test.go +++ b/config/muxer_test.go @@ -73,14 +73,14 @@ func TestCatchDuplicateTransportsMuxer(t *testing.T) { }{ "no duplicate transports": { h: h, - transports: []MsMuxC{MsMuxC{yamuxMuxer, "yamux"}}, + transports: []MsMuxC{{yamuxMuxer, "yamux"}}, expectedError: "", }, "duplicate transports": { h: h, transports: []MsMuxC{ - MsMuxC{yamuxMuxer, "yamux"}, - MsMuxC{yamuxMuxer, "yamux"}, + {yamuxMuxer, "yamux"}, + {yamuxMuxer, "yamux"}, }, expectedError: "duplicate muxer transport: yamux", }, diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index ed925472..8fadaac6 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -558,7 +558,7 @@ func TestAddrResolution(t *testing.T) { p2paddr3 := ma.StringCast("/ip4/192.0.2.1/tcp/123/p2p/" + p2.Pretty()) backend := &madns.MockResolver{ - TXT: map[string][]string{"_dnsaddr.example.com": []string{ + TXT: map[string][]string{"_dnsaddr.example.com": { "dnsaddr=" + p2paddr2.String(), "dnsaddr=" + p2paddr3.String(), }}, } @@ -607,14 +607,14 @@ func TestAddrResolutionRecursive(t *testing.T) { backend := &madns.MockResolver{ TXT: map[string][]string{ - "_dnsaddr.example.com": []string{ + "_dnsaddr.example.com": { "dnsaddr=" + p2paddr1i.String(), "dnsaddr=" + p2paddr2i.String(), }, - "_dnsaddr.foo.example.com": []string{ + "_dnsaddr.foo.example.com": { "dnsaddr=" + p2paddr1f.String(), }, - "_dnsaddr.bar.example.com": []string{ + "_dnsaddr.bar.example.com": { "dnsaddr=" + p2paddr2i.String(), }, }, diff --git a/p2p/host/basic/natmgr.go b/p2p/host/basic/natmgr.go index c7c1fd12..c770f94a 100644 --- a/p2p/host/basic/natmgr.go +++ b/p2p/host/basic/natmgr.go @@ -131,8 +131,8 @@ func (nmgr *natManager) sync() { // new mappings. func (nmgr *natManager) doSync() { ports := map[string]map[int]bool{ - "tcp": map[int]bool{}, - "udp": map[int]bool{}, + "tcp": {}, + "udp": {}, } for _, maddr := range nmgr.net.ListenAddresses() { // Strip the IP