diff options
author | Adin Scannell <ascannell@google.com> | 2021-01-12 12:36:17 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-12 12:38:22 -0800 |
commit | 4e03e87547853523d4ff941935a6ef1712518c61 (patch) | |
tree | e930ce0e5f15f7041e7b74daca05acc7afbd2558 /pkg/tcpip/network | |
parent | a20da708291e2e5bdece5176dce61c1b4b10b7d9 (diff) |
Fix simple mistakes identified by goreportcard.
These are primarily simplification and lint mistakes. However, minor
fixes are also included and tests added where appropriate.
PiperOrigin-RevId: 351425971
Diffstat (limited to 'pkg/tcpip/network')
-rw-r--r-- | pkg/tcpip/network/ipv6/icmp_test.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/network/ipv6/mld_test.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/network/ipv6/ndp_test.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/network/multicast_group_test.go | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/pkg/tcpip/network/ipv6/icmp_test.go b/pkg/tcpip/network/ipv6/icmp_test.go index 34a6a8446..bbce1ef78 100644 --- a/pkg/tcpip/network/ipv6/icmp_test.go +++ b/pkg/tcpip/network/ipv6/icmp_test.go @@ -1535,7 +1535,7 @@ func TestPacketQueing(t *testing.T) { } s.SetRouteTable([]tcpip.Route{ - tcpip.Route{ + { Destination: host1IPv6Addr.AddressWithPrefix.Subnet(), NIC: nicID, }, diff --git a/pkg/tcpip/network/ipv6/mld_test.go b/pkg/tcpip/network/ipv6/mld_test.go index e2778b656..f6ffa7133 100644 --- a/pkg/tcpip/network/ipv6/mld_test.go +++ b/pkg/tcpip/network/ipv6/mld_test.go @@ -267,7 +267,7 @@ func TestSendQueuedMLDReports(t *testing.T) { globalMulticastAddr: false, linkLocalAddrSNMC: false, } - for _ = range addrs { + for range addrs { p, ok := e.Read() if !ok { t.Fatalf("expected MLD report for %s and %s; addrs = %#v", globalMulticastAddr, linkLocalAddrSNMC, addrs) diff --git a/pkg/tcpip/network/ipv6/ndp_test.go b/pkg/tcpip/network/ipv6/ndp_test.go index 7ddb19c00..b1a5a5510 100644 --- a/pkg/tcpip/network/ipv6/ndp_test.go +++ b/pkg/tcpip/network/ipv6/ndp_test.go @@ -581,7 +581,7 @@ func TestNeighorSolicitationResponse(t *testing.T) { } s.SetRouteTable([]tcpip.Route{ - tcpip.Route{ + { Destination: header.IPv6EmptySubnet, NIC: 1, }, diff --git a/pkg/tcpip/network/multicast_group_test.go b/pkg/tcpip/network/multicast_group_test.go index 05d98a0a5..0f4f0e1e1 100644 --- a/pkg/tcpip/network/multicast_group_test.go +++ b/pkg/tcpip/network/multicast_group_test.go @@ -1095,7 +1095,7 @@ func TestMGPWithNICLifecycle(t *testing.T) { seen[a] = false } - for i, _ := range test.multicastAddrs { + for i := range test.multicastAddrs { p, ok := e.Read() if !ok { t.Fatalf("expected (%d-th) leave message to be sent", i) @@ -1122,7 +1122,7 @@ func TestMGPWithNICLifecycle(t *testing.T) { seen[a] = false } - for i, _ := range test.multicastAddrs { + for i := range test.multicastAddrs { p, ok := e.Read() if !ok { t.Fatalf("expected (%d-th) report message to be sent", i) @@ -1143,7 +1143,7 @@ func TestMGPWithNICLifecycle(t *testing.T) { if got := sentLeaveStat.Value(); got != leaveCounter { t.Errorf("got sentLeaveStat.Value() = %d, want = %d", got, leaveCounter) } - for i, _ := range test.multicastAddrs { + for i := range test.multicastAddrs { if _, ok := e.Read(); !ok { t.Fatalf("expected (%d-th) leave message to be sent", i) } |