Skip to content

fix staticcheck error#1761

Merged
methane merged 1 commit intogo-sql-driver:masterfrom
methane:fix-staticcheck
Apr 21, 2026
Merged

fix staticcheck error#1761
methane merged 1 commit intogo-sql-driver:masterfrom
methane:fix-staticcheck

Conversation

@methane
Copy link
Copy Markdown
Member

@methane methane commented Apr 20, 2026

Description

remove unnecessary nil check.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1cd6b059-3a49-4410-a27c-2e7f55f40270

📥 Commits

Reviewing files that changed from the base of the PR and between a0d80bf and 9c254dd.

📒 Files selected for processing (1)
  • driver_test.go

Walkthrough

The TestTLS test function in driver_test.go simplifies cipher value validation by removing an explicit nil-guard check. The validation now relies solely on the length check, as dereferencing a non-nil pointer with an empty slice still returns zero length.

Changes

Cohort / File(s) Summary
Test Update
driver_test.go
Simplified cipher validation logic in TestTLS by removing redundant nil-check in pointer dereference validation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • shogo82148
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix staticcheck error' accurately reflects the main change: removing an unnecessary nil check to resolve a staticcheck linting issue.
Description check ✅ Passed The description is directly related to the changeset, clearly stating the purpose of removing an unnecessary nil check that was flagged by staticcheck.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 82.409%. first build — methane:fix-staticcheck into go-sql-driver:master

@methane methane merged commit ab9e380 into go-sql-driver:master Apr 21, 2026
36 of 37 checks passed
@methane methane deleted the fix-staticcheck branch April 21, 2026 03:43
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.

3 participants