-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
ai-generatedcookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerslow-priorityplan
Description
Objective
Replace 10 instances of redundant make([]T, 0) allocations with idiomatic zero-value slices.
Context
From discussion #12006: Sergo analysis found explicit zero-capacity slice allocations that are less idiomatic and create unnecessary overhead. Zero-value slices work perfectly with append and are the Go convention.
Files to Modify
pkg/workflow/mcp_setup_generator.go:607pkg/workflow/jobs.go:48, 432pkg/workflow/action_cache.go:241, 242, 279pkg/workflow/compiler_safe_outputs_job.go:372pkg/workflow/step_order_validation.go:42
Approach
Replace patterns like:
envVarNames := make([]string, 0)
for _, name := range vars {
envVarNames = append(envVarNames, name)
}With idiomatic Go:
var envVarNames []string
for _, name := range vars {
envVarNames = append(envVarNames, name)
}Acceptance Criteria
- All 10 instances replaced with zero-value slice declarations
- All existing tests pass
- Code passes
go vetandgolangci-lint - No behavior changes (nil slices work identically with append)
AI generated by Plan Command for discussion #12006
Copilot
Metadata
Metadata
Labels
ai-generatedcookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerslow-priorityplan