Fix lint-go CI failures#31762
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job lint-go
Fix lint-go CI failures
May 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes lint-go CI failures by addressing five golangci-lint violations introduced in recent changes.
Changes:
- Modernized loops and string handling (
intrange,modernize) and appliedgofmt -scomposite literal simplifications. - Refactored
sync.Poolusage to store*[]byteto satisfystaticcheck SA6002. - Simplified a negated test condition using De Morgan’s law (
staticcheck QF1001).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/runtime_detection.go | Replaces an index-based loop with an integer range loop to satisfy intrange. |
| pkg/workflow/firewall_args_test.go | Simplifies a negated conjunction into ordered >= checks for QF1001. |
| pkg/workflow/engine_helpers.go | Uses strings.CutSuffix instead of HasSuffix + TrimSuffix (modernize). |
| pkg/workflow/compiler_experiments_sparse_interaction_warning_test.go | Applies gofmt -s composite literal element type elision. |
| pkg/cli/workflows.go | Adjusts sync.Pool buffer storage to avoid slice-header copies (SA6002). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
Comment on lines
+376
to
+377
| if after, found := strings.CutSuffix(cmdStr, " *"); found { | ||
| return after, true |
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.
Five golangci-lint violations introduced by recent changes were breaking the
lint-goCI job.Bug Fix
What was the bug?
The following linter errors were reported:
gofmtcompiler_experiments_sparse_interaction_warning_test.go[]stringtype inmap[string][]stringcomposite literalsintrangeruntime_detection.gomodernizeengine_helpers.goHasSuffix+TrimSuffixpair replaceable withCutSuffixstaticcheck SA6002workflows.gosync.Pool.Putcalled with[]byte(non-pointer), causing slice header copiesstaticcheck QF1001firewall_args_test.goHow did you fix it?
gofmt -s— removes redundant element types in composite literalsfor i := 0; i < len(words)-1; i++→for i := range len(words)-1HasSuffix + TrimSuffix→strings.CutSuffix*[]byteinstead of[]byte; defer writes back the (possibly reallocated) slice before returning the pointer!(A && B && C)→A >= B || B >= C || C >= D