fix: remove unnecessary panic("unreachable") after os.Exit(1) in auth_status.go - #695
Open
acarranoqovery wants to merge 1 commit into
Open
fix: remove unnecessary panic("unreachable") after os.Exit(1) in auth_status.go#695acarranoqovery wants to merge 1 commit into
acarranoqovery wants to merge 1 commit into
Conversation
…_status.go Same issue as flagged on cmd/api_spec.go: this pattern only guards against a real SA5011 false positive, and none of the three os.Exit(1) calls here are followed by code that dereferences anything from the failed call. Verified by removing all three and confirming staticcheck, go vet, and go build stay clean.
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
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
Follow-up to review feedback on #691 (
qovery api spec), which had the same issue:panic("unreachable") // staticcheck false positivewas copied by analogy intoauth_status.go(merged in #690) without checking it actually applied there.The pattern only matters when code after
os.Exit(1)dereferences something staticcheck's flow analysis can't prove is safe (staticcheck doesn't knowos.Exitnever returns). None of the threeos.Exit(1)calls inauth_status.goare followed by such a dereference, so there's nothing for staticcheck to misjudge.Test plan
panic("unreachable")linesstaticcheck ./cmd/...— no findings for this filego vet ./cmd/...— cleango build ./...— cleanSummary by cubic
Removes the redundant panic("unreachable") calls after os.Exit(1) in
auth_status.go; they were meant to guard against SA5011 but no dereference follows those exits, so they weren’t needed. Runtime behavior is unchanged; this just cleans up noise and avoids a misleading staticcheck comment.Written for commit 2017240. Summary will update on new commits.