Repository navigation
fix(lint): make non-Linux stubs pass staticcheck SA4023 on macOS - #2129
Merged
Merged
Conversation
The !linux stubs in internal/executionexecutor and the microVM guest agent returned an inline errors.New on every path, so staticcheck on darwin proved the error always non-nil and flagged the shared callers' err != nil checks as always true. Return a package-level sentinel instead; the analyzer cannot fold a mutable package variable. Linux builds do not compile these files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JAORMX
approved these changes
Oct 6, 2026
Merged
2 tasks
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.
Summary
task lintfailed on macOS with staticcheck SA4023 ("this comparison is always true"). The//go:build !linuxstubs returned an inlineerrors.New(...)on every path. On darwin, staticcheck therefore proved the error was never nil and flagged the shared callers'err != nilchecks.internal/executionexecutor) and a second case the issue missed (environment/microvm/cmd/mecatl-guest-agent). The second case was hidden becausetask lintstops at the first failing module.Issue relationship
Closes #2101
Type of change
Test plan
Baseline checks
task lint): 0 issues in all modules on macOS (arm64), and also withGOOS=linux task linttask test): not run; the only edits are in!linuxstub files that Linux CI does not compiletask test:race): not run, same reasongo run ./cmd/mecademo): not affectedtask docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdAlso verified:
GOOS=linux go buildsucceeds formecatl-executorandmecatl-guest-agent.Changes
internal/executionexecutor/command_unsupported.goerrCommandUnsupportedsentinelenvironment/microvm/cmd/mecatl-guest-agent/mounts_other.goerrRequiresLinuxsentinelUser-facing change
None. Contributors on macOS can now pass
task lint.Special notes for reviewers
!linuxfiles. AGOOS=darwinlint step on the existing runner would catch this class of failure; that is left for a follow-up.go test ./internal/executionexecutor/fails before and after this change. The tests in that package exercise Linux-only behavior. This is unrelated to the lint fix.🤖 Generated with Claude Code