{"id":15035147,"url":"https://github.com/jingyugao/rowserrcheck","last_synced_at":"2025-10-04T02:31:04.535Z","repository":{"id":50750806,"uuid":"220442630","full_name":"jingyugao/rowserrcheck","owner":"jingyugao","description":"Analyzer: checks whether err of sql.Rows is checked.","archived":false,"fork":true,"pushed_at":"2023-10-14T20:30:43.000Z","size":81,"stargazers_count":17,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-29T21:21:57.347Z","etag":null,"topics":["go","lint","ssa"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"timakin/bodyclose","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jingyugao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-08T10:24:35.000Z","updated_at":"2024-04-28T14:43:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jingyugao/rowserrcheck","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingyugao%2Frowserrcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingyugao%2Frowserrcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingyugao%2Frowserrcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingyugao%2Frowserrcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jingyugao","download_url":"https://codeload.github.com/jingyugao/rowserrcheck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235212731,"owners_count":18953660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","lint","ssa"],"created_at":"2024-09-24T20:27:39.472Z","updated_at":"2025-10-04T02:30:59.282Z","avatar_url":"https://github.com/jingyugao.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rowserrcheck\n\n[![CircleCI](https://circleci.com/gh/jingyugao/rowserrcheck.svg?style=svg)](https://circleci.com/gh/jingyugao/rowserrcheck)\n\n`rowserrcheck` is a static analysis tool which checks whether `sql.Rows.Err` is correctly checked.\n\n## Install\n\nYou can get `rowserrcheck` by `go get` command.\n\n```bash\n$ go get -u github.com/jingyugao/rowserrcheck\n```\n\n## Analyzer\n\n`rowserrcheck` validates whether [*database/sql.Rows](https://golang.org/pkg/database/sql/#Rows.Err) of sql query calls method `rows.Err()` such as below code.\n\n```go\nrows, _ := db.Query(\"select id from tb\") // Wrong case\nif err != nil {\n\t// handle error\n}\nfor rows.Next(){\n\t// handle rows\n}\n```\n\nThis code is wrong. You must check rows.Err when finished scan rows.\n\n```go\nrows, _ := db.Query(\"select id from tb\") // Wrong case\nfor rows.Next(){\n\t// handle rows\n}\nif rows.Err()!=nil{\n\t// handle err\n}\n```\n\nIn the [GoDoc of sql.Rows](https://golang.org/pkg/database/sql/#Rows) this rule is clearly described.\n\nIf you forget this sentence, and unluckly an `invaliad connection` error happend when fetch\ndata from database, `rows.Next` will return false, and you will get an incomplete data, and\neven it seems everything is ok. This will cause serious accident.\n\n## Thanks\nThanks for [timakin](https://github.com/jingyugao/rowserrcheck).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyugao%2Frowserrcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingyugao%2Frowserrcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyugao%2Frowserrcheck/lists"}