Repository navigation
chore(gitops): index the inventory units instead of copying each one - #1300
Merged
Merged
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
maincarries one golangci-lint finding since #1290: gocriticrangeValCopyinpkg/gitops/environment_declaration.go:36(serviceUnitNamescopies a 128-byteInventoryUnitper iteration).lintis not a required check, so the merge queue admitted it, butcodefly publishjudges every check-run on the release head (cmd/publish/landing.goinspectChecks), so the redlintcontext aborts every release pull request: v0.1.235 failed twice today (#1297, #1298) with this context red beside a docker-generate shard flake.Change
Index the slice and take a pointer; the function returns the same names. No behaviour change.
Classification
Fix at the place that owns the behaviour (the loop itself). Reused: nothing new; the repo's lint configuration is the rule.
Tests
golangci-lint run ./pkg/gitops/...: 1 issue before, 0 after.go test ./pkg/gitops/ -run 'Declaration|ServiceUnit'passes. The govet shadow the coordinator noted atcell.go:159does not exist onmainany more (the region moved with #1295).Not verified
Nothing beyond lint and the package tests; the change has no runtime path of its own.
🤖 Generated with Claude Code