Add a lint check to close SQL resources (stmts and rows)
This commit is contained in:
parent
4cabae45dd
commit
7f24bb7893
@ -30,6 +30,7 @@ linters:
|
||||
- gofmt
|
||||
- errorlint
|
||||
- nolintlint
|
||||
- sqlclosecheck
|
||||
|
||||
|
||||
# Useless linters:
|
||||
|
@ -226,6 +226,7 @@ func (p Profile) GetTweetDetail(id TweetID) (TweetDetailView, error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer stmt.Close()
|
||||
|
||||
// Main tweet and parents
|
||||
var thread []Tweet
|
||||
@ -257,6 +258,7 @@ func (p Profile) GetTweetDetail(id TweetID) (TweetDetailView, error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer stmt.Close()
|
||||
err = stmt.Select(&replies, id)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -66,6 +66,7 @@ func (p Profile) GetSpaceById(id scraper.SpaceID) (space scraper.Space, err erro
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
err = nil
|
||||
}
|
||||
defer rows.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -213,6 +213,7 @@ func (p Profile) GetAllFollowedUsers() []scraper.UserHandle {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
ret := []scraper.UserHandle{}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user