fix(lint): resolve all errcheck findings (unblock CI Lint for v1.7.0)#216
Conversation
Check unchecked error/return values flagged by golangci-lint errcheck (check-type-assertions enabled): discard intentional fmt.Fprint* writes to stdout/io.Writer with _, _ =, guard test-side type assertions with require.True, and check a deferred/plain Close. errcheck is now clean repo-wide. Scope: errcheck only. Pre-existing gocritic/misspell/unused findings that CI tolerates (only-new-issues mode) are intentionally left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Review
Critical issues
None.
Security
No security concerns flagged.
Test coverage
Changes are errcheck-only mechanical fixes (discarded writes to stdout/writers, guarded type assertions, checked Close() returns); no new production logic requiring tests.
No critical issues — LGTM pending human review.
There was a problem hiding this comment.
Gemini Review
Critical Issues
None.
Security
No security concerns flagged.
Suggestions
- In
cmd/brutus/cmd_enum_lusha_test.go(around line 125),phones[0]is accessed immediately after the type assertionphones, ok := obj["phones"].([]interface{}). Consider addingrequire.Len(t, phones, 1)before indexing to prevent a potential out-of-bounds panic if the array is unexpectedly empty, mirroring the safer pattern used in other test cases (e.g., lines 80 and 513).
Reviewed by Gemini (gemini-3.1-pro-preview)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
WalkthroughThis change set explicitly discards return values from Changes
Sequence Diagram(s)Not applicable; changes are localized error-handling and output adjustments without new interaction flows. Related Issues: Not specified in provided data. Related PRs: Not specified in provided data. Suggested labels: cleanup, tests, lint Suggested reviewers: Not specified in provided data. Poem: ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Makes CI Lint green so we can cut v1.7.0. The dev→main merge (#214) surfaced
errcheckfailures (golangci-lint,check-type-assertions: true). This resolves all errcheck findings repo-wide.Changes (errcheck only)
fmt.Fprint*writes to stdout /io.Writerwith_, _ =(cmd_enum_github.go,cmd_enum_github_map.go,cmd_enum_google.go,cmd_enum_teams.go,progress.go,examples/enum-custom-demo/main.go)require.True(t, ok)(cmd_enum_lusha_test.go)Close()returns (realframes_test.go,google_test.go)fmt.Fprint*writes tohttptestresponse writers (github_test.go)Verification
golangci-lint run --max-same-issues=0 --max-issues-per-linter=0 ./...→ 0 errcheck findings (verified locally with a go1.26-built golangci-lint v2.12.1, matching CI's config)go build ./...— cleango test ./...— passinggofmt— cleanScope note
errcheck only. The repo has ~48 pre-existing
gocritic/misspell/unused/staticcheckfindings that CI tolerates (it runs golangci-lint in only-new-issues mode). Those are intentionally left untouched to avoid unrelated churn.🤖 Generated with Claude Code