diff --git a/api/types/network/endpoint_test.go b/api/types/network/endpoint_test.go index 878a16f2d0..814891d4e6 100644 --- a/api/types/network/endpoint_test.go +++ b/api/types/network/endpoint_test.go @@ -23,7 +23,7 @@ func (stub subnetStub) Contains(addr net.IP) bool { } func TestEndpointIPAMConfigWithOutOfRangeAddrs(t *testing.T) { - testcases := []struct { + tests := []struct { name string ipamConfig *EndpointIPAMConfig v4Subnets []NetworkSubnet @@ -80,8 +80,7 @@ func TestEndpointIPAMConfigWithOutOfRangeAddrs(t *testing.T) { }, } - for _, tc := range testcases { - tc := tc + for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() @@ -105,7 +104,7 @@ func TestEndpointIPAMConfigWithOutOfRangeAddrs(t *testing.T) { } func TestEndpointIPAMConfigWithInvalidConfig(t *testing.T) { - testcases := []struct { + tests := []struct { name string ipamConfig *EndpointIPAMConfig expectedErrors []string @@ -162,8 +161,7 @@ func TestEndpointIPAMConfigWithInvalidConfig(t *testing.T) { }, } - for _, tc := range testcases { - tc := tc + for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/api/types/network/ipam_test.go b/api/types/network/ipam_test.go index 446dbae8aa..8225e56bbe 100644 --- a/api/types/network/ipam_test.go +++ b/api/types/network/ipam_test.go @@ -8,7 +8,7 @@ import ( ) func TestNetworkWithInvalidIPAM(t *testing.T) { - testcases := []struct { + tests := []struct { name string ipam IPAM ipv6 bool @@ -123,8 +123,7 @@ func TestNetworkWithInvalidIPAM(t *testing.T) { }, } - for _, tc := range testcases { - tc := tc + for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel()