KEMBAR78
Ensure mysql rows responses are closed by timvaillancourt · Pull Request #1132 · github/gh-ost · GitHub
Skip to content

Conversation

@timvaillancourt
Copy link
Collaborator

@timvaillancourt timvaillancourt commented May 31, 2022

Description

This PR ensures the rows-responses from the MySQL driver are closed by using a defer rows.Close(), in order to follow database/sql best practices

Also, these linters are introduced to ensure we don't have this problem again:

  1. rowserrcheck

    checks whether Err of rows is checked successfully

  2. sqlclosecheck

    Checks that sql.Rows and sql.Stmt are closed

This PR resolves these linter errors:
Screen Shot 2022-06-01 at 01 25 56

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

@timvaillancourt timvaillancourt requested review from a user and rashiq May 31, 2022 23:38
@timvaillancourt timvaillancourt self-assigned this May 31, 2022
@timvaillancourt timvaillancourt added this to the v1.1.5 milestone Jun 2, 2022
@timvaillancourt timvaillancourt merged commit 6bf32f2 into github:master Jul 6, 2022
@timvaillancourt timvaillancourt deleted the golangci-lint-sql-linters branch July 6, 2022 21:32
ghost pushed a commit that referenced this pull request Jul 7, 2022
Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
@ghost ghost mentioned this pull request Jul 7, 2022
ghost pushed a commit that referenced this pull request Jul 7, 2022
Co-authored-by: dm-2 <45519614+dm-2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant