Skip to content

fix: remove unnecessary panic("unreachable") after os.Exit(1) in auth_status.go - #695

Open
acarranoqovery wants to merge 1 commit into
mainfrom
fix/auth-status-unreachable-panics
Open

fix: remove unnecessary panic("unreachable") after os.Exit(1) in auth_status.go#695
acarranoqovery wants to merge 1 commit into
mainfrom
fix/auth-status-unreachable-panics

Conversation

@acarranoqovery

@acarranoqovery acarranoqovery commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to review feedback on #691 (qovery api spec), which had the same issue: panic("unreachable") // staticcheck false positive was copied by analogy into auth_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 know os.Exit never returns). None of the three os.Exit(1) calls in auth_status.go are followed by such a dereference, so there's nothing for staticcheck to misjudge.

Test plan

  • Removed all three panic("unreachable") lines
  • staticcheck ./cmd/... — no findings for this file
  • go vet ./cmd/... — clean
  • go build ./... — clean

Summary 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.

Review in cubic

…_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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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.

1 participant