Fix Go linting errors - unused append results and test assertion pattern#16193
Merged
Fix Go linting errors - unused append results and test assertion pattern#16193
Conversation
…Error Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add linters for Go code
Fix Go linting errors - unused append results and test assertion pattern
Feb 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Go linting errors identified by CI: two staticcheck SA4010 violations (unused append results) and one testifylint violation (incorrect test assertion pattern).
Changes:
- Removed unused
errorMessagesvariable and appends inpkg/cli/compile_orchestration.go- error tracking is already handled viaValidationResult.ErrorsandtrackWorkflowFailure() - Changed
assert.Error()torequire.Error()inpkg/stringutil/pat_validation_test.goto comply with testifylint requirements - Updated 18 workflow lock files to include
GITHUB_SERVER_URLenvironment variable in repo-memory steps - these are auto-generated changes from the workflow compiler
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/cli/compile_orchestration.go | Removed unused errorMessages variable that was being appended to but never read |
| pkg/stringutil/pat_validation_test.go | Fixed testifylint violation by using require.Error() instead of assert.Error() for critical error assertions |
| .github/workflows/*.lock.yml (18 files) | Auto-generated: Added GITHUB_SERVER_URL: ${{ github.server_url }} to repo-memory clone and push steps for GitHub Enterprise support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Feb 16, 2026
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.
CI linting was failing with 3 errors: 2 staticcheck violations (SA4010) and 1 testifylint violation.
Changes
pkg/cli/compile_orchestration.go
errorMessagesvariable and associated append operationsValidationResult.ErrorsandtrackWorkflowFailure()pkg/stringutil/pat_validation_test.go
assert.Error()torequire.Error()for critical error assertionsrequireimportThe unused
errorMessagesslice was being appended to but never read - the local variable declaration shadowed any potential return value without assignment.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linu-lang=go1.24 GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-goversion(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha vrXP/jO9j2u5wg3AJYV_tvrXP ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /home/REDACTED/work/_temp/ghcca-node/node/bin/bash se 555567/b043/vet.rev-parse .cfg 088394/b398/importcfg --no�� 088394/b398/embedcfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ent.js 555567/b186/vet.rev-parse r: $owner, name:--show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v2/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v2 --jq .object.sha -json cfg e GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu-f ode_�� -json GO111MODULE ache/go/1.25.0/x-f GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xconfig(http block)/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v2 --jq .object.sha -json cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse ode_�� -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xconfig(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>-1 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse env -json GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet` (http block)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>-C 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linurev-parse` (http block)
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.