mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
bump go to 1.22
Many dependencies started using go 1.22 which means we have to follow in order to update. Disable the now depracted exportloopref linter as it was replaced by copyloopvar as go fixed the loop copy problem in 1.22[1] Another new chnage in go 1.22 is the for loop syntax over ints, the intrange linter chacks for this but there a lot of loops that have to be converted so I didn't do it here and disable th elinter for now, th eold syntax is still fine. [1] https://go.dev/blog/loopvar-preview Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -224,7 +224,6 @@ func TestConfigMapVolumes(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
result, err := VolumeFromConfigMap(test.volume.ConfigMap, test.configmaps)
|
||||
if test.errorMessage == "" {
|
||||
@ -434,7 +433,6 @@ func TestEnvVarsFrom(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
result, err := envVarsFrom(test.envFrom, &test.options)
|
||||
assert.Equal(t, err == nil, test.succeed)
|
||||
@ -1027,7 +1025,6 @@ func TestEnvVarValue(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
result, err := envVarValue(test.envVar, &test.options)
|
||||
assert.Equal(t, err == nil, test.succeed)
|
||||
@ -1270,7 +1267,6 @@ func TestHttpLivenessProbe(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
err := setupLivenessProbe(&test.specGenerator, test.container, test.restartPolicy)
|
||||
if err == nil {
|
||||
@ -1393,7 +1389,6 @@ func TestTCPLivenessProbe(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
err := setupLivenessProbe(&test.specGenerator, test.container, test.restartPolicy)
|
||||
assert.Equal(t, err == nil, test.succeed)
|
||||
|
@ -212,7 +212,6 @@ func ParsePortMapping(portMappings []types.PortMapping, exposePorts map[uint16][
|
||||
|
||||
for hostIP, protoMap := range portMap {
|
||||
for protocol, ports := range protoMap {
|
||||
ports := ports
|
||||
if len(ports) == 0 {
|
||||
continue
|
||||
}
|
||||
|
@ -433,7 +433,6 @@ func TestParsePortMappingWithHostPort(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := ParsePortMapping(tt.arg, tt.arg2)
|
||||
assert.NoError(t, err, "error is not nil")
|
||||
@ -668,7 +667,6 @@ func TestParsePortMappingWithoutHostPort(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := ParsePortMapping(tt.arg, tt.arg2)
|
||||
assert.NoError(t, err, "error is not nil")
|
||||
@ -847,7 +845,6 @@ func TestParsePortMappingMixedHostPort(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := ParsePortMapping(tt.arg, nil)
|
||||
assert.NoError(t, err, "error is not nil")
|
||||
@ -982,7 +979,6 @@ func TestParsePortMappingError(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
_, err := ParsePortMapping(tt.arg, nil)
|
||||
assert.EqualError(t, err, tt.err, "error does not match")
|
||||
|
Reference in New Issue
Block a user