Skip to content

silence errcheck on errChan drains - #1023

Closed
dogancanbakir wants to merge 1 commit into
mainfrom
fix/1022-errcheck-lint
Closed

dogancanbakir wants to merge 1 commit into
mainfrom
fix/1022-errcheck-lint

Conversation

@dogancanbakir

@dogancanbakir dogancanbakir commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Fixes #1022

The drained handshake result is irrelevant after a timeout; the existing comment already explains why it is drained.

Summary by CodeRabbit

  • Chores
    • Clarified static analysis handling for TLS handshake error checks.
    • No user-facing behavior or public API changes.

@dogancanbakir dogancanbakir self-assigned this Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 334c5c2e-568b-4901-aad1-4c36d218a51f
📥 Commits

Reviewing files that changed from the base of the PR and between 7f24430 and 8263628.

📒 Files selected for processing: 2
  • pkg/tlsx/tls/tls.go
  • pkg/tlsx/ztls/ztls.go

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

The TLS and ztls implementations now mark four handshake error-channel receives with //nolint:errcheck. Handshake and timeout behavior is unchanged.

Changes

Handshake lint annotations

Layer / File(s) Summary
Handshake receive annotations
pkg/tlsx/tls/tls.go, pkg/tlsx/ztls/ztls.go
Both implementations add //nolint:errcheck comments to handshake and cipher-enumeration error-channel receives. Runtime behavior remains unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: mzack9999

Merge Risk: ⚪ Minimal · up to 82636

The PR addresses the reported lint failure without changing handshake or timeout behavior.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: suppressing errcheck findings for errChan drains in the TLS implementations.
Linked Issues check Passed Issue #1022 requires the unchecked errChan drains in pkg/tlsx/tls/tls.go and pkg/tlsx/ztls/ztls.go to stop failing errcheck. The diff adds //nolint:errcheck to all four affected receives: tw…
Out of Scope Changes check Passed The diff changes only the four errChan drain annotations in the two files named by issue #1022. The annotations directly address the lint failure. No unrelated behavior or public API changes are pre…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Linked Issues check

Explanation

Issue #1022 requires the unchecked errChan drains in pkg/tlsx/tls/tls.go and pkg/tlsx/ztls/ztls.go to stop failing errcheck. The diff adds //nolint:errcheck to all four affected receives: two in tls.go and two in ztls.go. The existing timeout drain behavior remains unchanged.

Full details: Out of Scope Changes check

Explanation

The diff changes only the four errChan drain annotations in the two files named by issue #1022. The annotations directly address the lint failure. No unrelated behavior or public API changes are present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the handshake line,
Four lint notes make the markers shine.
The timeout path stays as before,
The cipher scan keeps its same chore.
I twitch my nose and hop away.

Comment @coderabbitai help to get the list of available commands.

@dogancanbakir

Copy link
Copy Markdown
Member Author

Already fixed on dev by #1015 (errcheck on errChan drains). It reaches main with the next release.

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.

lint: unchecked errChan drains fail errcheck

1 participant