From dbb50f0de2d9cbdb6f390bd7274285eacd28b9e7 Mon Sep 17 00:00:00 2001 From: Antoine Toussaint <312536060+antoinetoussaint-byte@users.noreply.github.com> Date: Wed, 4 Nov 2026 01:25:51 -0500 Subject: [PATCH] chore(gitops): index the inventory units instead of copying each one golangci-lint's gocritic rangeValCopy flags serviceUnitNames copying a 128-byte InventoryUnit per iteration (pkg/gitops/environment_declaration.go, since #1290). Lint is not a required check, so main carried it; this clears it without changing what the function returns. Co-Authored-By: Claude Fable 5.1 --- pkg/gitops/environment_declaration.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gitops/environment_declaration.go b/pkg/gitops/environment_declaration.go index 50fbe118..78db8375 100644 --- a/pkg/gitops/environment_declaration.go +++ b/pkg/gitops/environment_declaration.go @@ -33,7 +33,8 @@ import ( // digests the same at both ends. Solution units are not among them. func serviceUnitNames(units []InventoryUnit) []string { var names []string - for _, unit := range units { + for i := range units { + unit := &units[i] if unit.Kind == UnitKindService && unit.Name != "" { names = append(names, unit.Name) }