run gofmt -s

This commit is contained in:
web3-bot 2021-04-29 21:35:37 +00:00
parent 252fd257d4
commit 218f33bc62
3 changed files with 9 additions and 9 deletions

View File

@ -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",
},

View File

@ -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(),
},
},

View File

@ -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