From 34d4943357cc46baf8c6e67448b401f0121a9430 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 1 Apr 2021 09:54:54 -0700 Subject: [PATCH] all: gofmt -s The code is not obviously better or worse, but this makes the little warning triangle in my editor go away, and the distraction removal is worth it. Signed-off-by: Josh Bleecher Snyder --- tailcfg/tailcfg_test.go | 8 ++++---- wgengine/magicsock/magicsock_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tailcfg/tailcfg_test.go b/tailcfg/tailcfg_test.go index 068a6a149..d679810d0 100644 --- a/tailcfg/tailcfg_test.go +++ b/tailcfg/tailcfg_test.go @@ -164,13 +164,13 @@ func TestHostinfoEqual(t *testing.T) { }, { - &Hostinfo{Services: []Service{Service{Proto: TCP, Port: 1234, Description: "foo"}}}, - &Hostinfo{Services: []Service{Service{Proto: UDP, Port: 2345, Description: "bar"}}}, + &Hostinfo{Services: []Service{{Proto: TCP, Port: 1234, Description: "foo"}}}, + &Hostinfo{Services: []Service{{Proto: UDP, Port: 2345, Description: "bar"}}}, false, }, { - &Hostinfo{Services: []Service{Service{Proto: TCP, Port: 1234, Description: "foo"}}}, - &Hostinfo{Services: []Service{Service{Proto: TCP, Port: 1234, Description: "foo"}}}, + &Hostinfo{Services: []Service{{Proto: TCP, Port: 1234, Description: "foo"}}}, + &Hostinfo{Services: []Service{{Proto: TCP, Port: 1234, Description: "foo"}}}, true, }, { diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index b58e4bb21..418111bf0 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -93,7 +93,7 @@ func runDERPAndStun(t *testing.T, logf logger.Logf, l nettype.PacketListener, st m := &tailcfg.DERPMap{ Regions: map[int]*tailcfg.DERPRegion{ - 1: &tailcfg.DERPRegion{ + 1: { RegionID: 1, RegionCode: "test", Nodes: []*tailcfg.DERPNode{ @@ -439,7 +439,7 @@ func TestPickDERPFallback(t *testing.T) { // But move if peers are elsewhere. const otherNode = 789 c.addrsByKey = map[key.Public]*addrSet{ - key.Public{1}: &addrSet{ipPorts: []netaddr.IPPort{{IP: derpMagicIPAddr, Port: otherNode}}}, + {1}: {ipPorts: []netaddr.IPPort{{IP: derpMagicIPAddr, Port: otherNode}}}, } if got := c.pickDERPFallback(); got != otherNode { t.Errorf("didn't join peers: got %v; want %v", got, someNode) @@ -1328,12 +1328,12 @@ func TestDiscoMessage(t *testing.T) { peer1Pub := c.DiscoPublicKey() peer1Priv := c.discoPrivate c.endpointOfDisco = map[tailcfg.DiscoKey]*discoEndpoint{ - tailcfg.DiscoKey(peer1Pub): &discoEndpoint{ + tailcfg.DiscoKey(peer1Pub): { // ... (enough for this test) }, } c.nodeOfDisco = map[tailcfg.DiscoKey]*tailcfg.Node{ - tailcfg.DiscoKey(peer1Pub): &tailcfg.Node{ + tailcfg.DiscoKey(peer1Pub): { // ... (enough for this test) }, }