mirror of
https://github.com/moby/moby.git
synced 2026-08-03 14:41:03 +00:00
api/types/network: remove redundant capturing of loop vars (copyloopvar)
api/types/network/endpoint_test.go:84:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
tc := tc
^
api/types/network/endpoint_test.go:166:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
tc := tc
^
api/types/network/ipam_test.go:127:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
tc := tc
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user