diff --git a/.golangci.yml b/.golangci.yml index cc01cfdff..e99a71e83 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,7 @@ linters: - ineffassign - misspell - nolintlint + - sqlclosecheck - typecheck - unconvert - unparam diff --git a/cmd/contact-auditor/main.go b/cmd/contact-auditor/main.go index d6b366b6b..fdec0c660 100644 --- a/cmd/contact-auditor/main.go +++ b/cmd/contact-auditor/main.go @@ -131,7 +131,7 @@ func (c contactAuditor) run(ctx context.Context, resChan chan *result) error { } } // Ensure the query wasn't interrupted before it could complete. - err = rows.Close() + err = rows.Close() //nolint:sqlclosecheck // the lint wants us to do this in a defer instead, but we want to return the error if err != nil { return err } else { diff --git a/test/db.go b/test/db.go index 26212133f..bd778a793 100644 --- a/test/db.go +++ b/test/db.go @@ -113,6 +113,7 @@ func allTableNamesInDB(ctx context.Context, db CleanUpDB) ([]string, error) { if err != nil { return nil, err } + defer r.Close() var ts []string for r.Next() { tableName := ""