No description
  • Go 97.2%
  • Makefile 2.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-01 17:40:44 +02:00
.github chore(deps): bump zizmorcore/zizmor-action from 0.6.1 to 0.6.2 in the github-actions group (#8) 2026-09-01 15:10:50 +00:00
passes/rowserr chore: cleaning 2026-04-19 23:44:25 +02:00
.gitignore chore: improve gitignore 2026-04-19 11:18:36 +02:00
.golangci.yml chore: update linter 2026-09-01 17:03:32 +02:00
go.mod chore(deps): bump golang.org/x/tools from 0.48.0 to 0.49.0 in the go group across 1 directory (#7) 2026-09-01 17:40:44 +02:00
go.sum chore(deps): bump golang.org/x/tools from 0.48.0 to 0.49.0 in the go group across 1 directory (#7) 2026-09-01 17:40:44 +02:00
LICENSE Initial commit 2019-03-23 11:09:49 +09:00
main.go chore: change module name 2026-04-19 11:18:36 +02:00
Makefile chore: set up GHA 2026-04-19 11:18:36 +02:00
README.md chore: change module name 2026-04-19 11:18:36 +02:00

rowserrcheck

Important

This is a fork of rowserrcheck. This is a hard fork because rowserrcheck is a fork of bodyclose. GitHub does not allow forking two forks of the same repository.

rowserrcheck is a static analysis tool which checks whether sql.Rows.Err is correctly checked.

Install

go install github.com/golangci/rowserrcheck@latest

Analyzer

rowserrcheck validates whether *database/sql.Rows of sql query calls method rows.Err() such as below code.

rows, _ := db.Query("select id from tb") // Wrong case
if err != nil {
	// handle error
}
for rows.Next(){
	// handle rows
}

This code is wrong. You must check rows.Err when finished scan rows.

rows, _ := db.Query("select id from tb") // Wrong case
for rows.Next(){
	// handle rows
}
if rows.Err()!=nil{
	// handle err
}

In the GoDoc of sql.Rows this rule is clearly described.

If you forget this sentence, and unluckly an invaliad connection error happend when fetch data from database, rows.Next will return false, and you will get an incomplete data, and even it seems everything is ok. This will cause serious accident.

Thanks

Thanks for timakin.