-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature Request: support close inside function call #7
Comments
I will see what I can do. |
Is there any estimate when this can be fixed? |
big +1 this would help us too, we are wrapping the Close function in a helper function with signature |
This would be nice for some code I maintain, because I, too, have a wrapper function - rows, err := tx.Query(query)
if err != nil {
return err
}
defer rows.Close() which causes a lint issue with rows, err := tx.Query(query)
if err != nil {
return err
}
defer log.Close(rows) which causes this lint "issue" to appear. |
I will spend some time on this project over the next few weeks. I will take a look at this. |
I would like to be able call a function to close my sqlx.Stmt structs to reduce dublicate code using a function like:
But the version of sqlclosecheck in golangci-lint v1.30 will throw an error because it thinks I'm not closing the struct
pkg/database/client.go:174:34: Rows/Stmt was not closed (sqlclosecheck) statement, err := c.db.Preparex(findUserOptions)
If you think this feature is possible and worthwhile I'm interested in working on it
The text was updated successfully, but these errors were encountered: