Skip to content

Fix S1011 staticcheck lint failure in central_slash_command_workflow.go#31858

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-lint-go-failure
May 13, 2026
Merged

Fix S1011 staticcheck lint failure in central_slash_command_workflow.go#31858
pelikhan merged 3 commits into
mainfrom
copilot/fix-lint-go-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Bug Fix

What was the bug?

golangci-lint (staticcheck S1011) was failing CI on pkg/workflow/central_slash_command_workflow.go — a for loop was appending slice elements one-by-one instead of using the idiomatic append(...spread) form.

How did you fix it?

Replaced the inner loop with a single append call using the spread operator:

// Before
for _, route := range buildCentralizedRoutes(wd, routeEvents) {
    routesByCommand[commandName] = append(routesByCommand[commandName], route)
}

// After
routesByCommand[commandName] = append(routesByCommand[commandName], buildCentralizedRoutes(wd, routeEvents)...)

No behavioral change — purely a style/lint conformance fix.

Copilot AI and others added 2 commits May 13, 2026 05:06
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…l_slash_command_workflow.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job lint-go Fix S1011 staticcheck lint failure in central_slash_command_workflow.go May 13, 2026
Copilot AI requested a review from pelikhan May 13, 2026 05:10
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 05:26
Copilot AI review requested due to automatic review settings May 13, 2026 05:26
@pelikhan pelikhan merged commit 06cc575 into main May 13, 2026
@pelikhan pelikhan deleted the copilot/fix-lint-go-failure branch May 13, 2026 05:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a golangci-lint / staticcheck S1011 issue by replacing a per-element append loop with an idiomatic append(dst, src...) when aggregating centralized slash-command routes.

Changes:

  • Simplified route aggregation in collectCentralSlashCommandRoutes using a single spread append.
  • Minor whitespace-only change in the generated agentic_commands.yml workflow file.
Show a summary per file
File Description
pkg/workflow/central_slash_command_workflow.go Replaces an inner append loop with append(..., buildCentralizedRoutes(...)...) to satisfy S1011.
.github/workflows/agentic_commands.yml Adds a blank line in the permissions block (whitespace-only change).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 50 to 52
discussions: write

steps:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants