Description
The custom-lint scanner (string-builder rule) found 41 instances of repeated += string concatenation inside loops across pkg/workflow (18 findings) and pkg/cli (23 findings). Each instance allocates a new string on every iteration; replacing with strings.Builder eliminates O(n2) allocations for long outputs.
Scope
- 41 total findings (
string-builder lint rule)
pkg/workflow/ — 18 findings
pkg/cli/ — 23 findings
Suggested Changes
Replace patterns like:
result := ""
for _, item := range items {
result += item + "\n" // new allocation each iteration
}
With:
var sb strings.Builder
for _, item := range items {
sb.WriteString(item)
sb.WriteByte('\n')
}
result := sb.String()
Validation
Run make golint-custom after changes to verify the string-builder findings are resolved.
Files Affected
- Multiple files in
pkg/workflow/ (18 sites)
- Multiple files in
pkg/cli/ (23 sites)
- (Run
make golint-custom 2>&1 | grep string-builder to get the exact list)
Success Criteria
make golint-custom reports 0 string-builder findings
make test-unit passes
- No functional behavior changes
Source
Extracted from discussion #48252 — LintMonster Daily custom-lint scan summary 2026-07-27
Priority
Medium — 41 O(n2) allocation sites; low risk to fix, good performance improvement for larger inputs
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 42.7 AIC · ⌖ 5.66 AIC · ⊞ 7.2K · ◷
Description
The custom-lint scanner (
string-builderrule) found 41 instances of repeated+=string concatenation inside loops acrosspkg/workflow(18 findings) andpkg/cli(23 findings). Each instance allocates a new string on every iteration; replacing withstrings.Buildereliminates O(n2) allocations for long outputs.Scope
string-builderlint rule)pkg/workflow/— 18 findingspkg/cli/— 23 findingsSuggested Changes
Replace patterns like:
With:
Validation
Run
make golint-customafter changes to verify the string-builder findings are resolved.Files Affected
pkg/workflow/(18 sites)pkg/cli/(23 sites)make golint-custom 2>&1 | grep string-builderto get the exact list)Success Criteria
make golint-customreports 0string-builderfindingsmake test-unitpassesSource
Extracted from discussion #48252 — LintMonster Daily custom-lint scan summary 2026-07-27
Priority
Medium — 41 O(n2) allocation sites; low risk to fix, good performance improvement for larger inputs