Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: rowserrcheck #1164

Merged
merged 1 commit into from
Jan 26, 2024
Merged

lint: rowserrcheck #1164

merged 1 commit into from
Jan 26, 2024

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Jan 26, 2024

It turns out rows.Next() can return false on error, avoiding error detection with rows.Scan

See golangci/golangci-lint#945

Fix that. In particular, QueryRowContext with checking for sql.ErrNowRows is much simpler when expecting 0 or 1 results

Mark two false positives when only wanting schema of LIMIT 0 query

It turns out `rows.Next()` can return false on error,
avoiding error detection with `rows.Scan`

See golangci/golangci-lint#945

Fix that. In particular, `QueryRowContext` with checking for `sql.ErrNowRows`
is much simpler when expecting 0 or 1 results

Mark two false positives when only wanting schema of `LIMIT 0` query
@serprex serprex merged commit 9dfa0b6 into main Jan 26, 2024
7 checks passed
@serprex serprex deleted the rowserrcheck branch January 26, 2024 17:16
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