We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thank you for the tool. Here's a repro of an issue I encountered.
Expected: The linter warns me that I never closed this rows
rows
Actual: Not detected
package sqlx_examples import ( "context" "database/sql" "log" "strings" ) func conditionalRowsMissingClose(onlyAdults bool) { age := 21 var ( rows *sql.Rows err error ) if onlyAdults { rows, err = db.QueryContext(context.Background(), "SELECT name FROM users WHERE age >= ?", age) } else { rows, err = db.QueryContext(context.Background(), "SELECT name FROM users", age) } if err != nil { log.Fatal(err) } // defer rows.Close() names := make([]string, 0) for rows.Next() { var name string if err := rows.Scan(&name); err != nil { log.Fatal(err) } names = append(names, name) } // Check for errors from iterating over rows. if err := rows.Err(); err != nil { log.Fatal(err) } log.Printf("%s are at least %d years old", strings.Join(names, ", "), age) }
The text was updated successfully, but these errors were encountered:
Thank you for the test case. I am adding to my list of things to look at. No hard ETA, hoping to have some time of the next couple of weeks.
Sorry, something went wrong.
No branches or pull requests
Thank you for the tool. Here's a repro of an issue I encountered.
Expected: The linter warns me that I never closed this
rows
Actual: Not detected
The text was updated successfully, but these errors were encountered: