Skip to content

chore: fix errcheck and staticcheck linting errors#1002

Open
3rabiii wants to merge 2 commits into
OneBusAway:mainfrom
3rabiii:fix-linting-erros
Open

chore: fix errcheck and staticcheck linting errors#1002
3rabiii wants to merge 2 commits into
OneBusAway:mainfrom
3rabiii:fix-linting-erros

Conversation

@3rabiii

@3rabiii 3rabiii commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Changes Included:

  • errcheck Fixes: Addressed unhandled errors from rows.Close() in gtfsdb/block_layover_test.go and gtfsdb/stops_rtree.go by wrapping them in anonymous defer functions.
  • staticcheck (QF1008) Fixes: Removed redundant embedded field selectors (e.g., calling .Time.Time or .ServiceDate.Time) in internal/models/current_time_test.go and internal/models/trip_details_test.go to utilize Go's promoted methods for cleaner syntax.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@3rabiii, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 52 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 20ef3a69-4311-4608-91d1-7aba99af9431

📥 Commits

Reviewing files that changed from the base of the PR and between 41be7c8 and 11aac72.

📒 Files selected for processing (4)
  • gtfsdb/block_layover_test.go
  • gtfsdb/stops_rtree.go
  • internal/models/current_time_test.go
  • internal/models/trip_details_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@3rabiii 3rabiii requested a review from burma-shave June 4, 2026 11:04
Comment thread gtfsdb/stops_rtree.go
return nil, err
}
defer rows.Close()
defer func() { _ = rows.Close() }()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The four defer rows.Close() changes should be reverted. The pattern doesn't need changing — in stops_rtree.go it intentionally mirrors sqlc-generated code, where plain defer rows.Close() is correct because any error Close() could return is already surfaced by rows.Err(). The same applies in block_layover_test.go.

@3rabiii 3rabiii Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@burma-shave Ok, I made this because when I run make lint on my local it gives me an errcheck. I will revert to the past pattern, but should I comment with //nolint:errcheck to bypass the local linter or ignore this errcheck?
image

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.

2 participants