fix: loop variable capture and linter (#7328)

Enable copyloopvar linter and remove redundant variable
shadowing in Kubernetes plugin metadata handling. This pattern is
no longer needed in Go 1.22+ where loop variables are automatically
captured correctly in closures.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
Ville Vesilehto
2025-05-28 00:44:20 +03:00
committed by GitHub
parent 481b795895
commit 7bd43af427
2 changed files with 2 additions and 2 deletions

View File

@@ -2,13 +2,14 @@ version: "2"
linters:
default: none
enable:
- copyloopvar
- govet
- ineffassign
- staticcheck
- unconvert
- unused
- whitespace
- usetesting
- whitespace
exclusions:
generated: lax
presets:

View File

@@ -21,7 +21,6 @@ func (k *Kubernetes) Metadata(ctx context.Context, state request.Request) contex
})
for k, v := range pod.Labels {
v := v
metadata.SetValueFunc(ctx, "kubernetes/client-label/"+k, func() string {
return v
})