mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Misc fixes and refactoring

Open julienschmidt opened this issue 5 years ago • 2 comments

Description

This PR includes a collection of different kinds of fixes (see commit messages below) to issues found with the help of several linters, ranging from missing error checks, to resource leaks because of unclosed rows / statements (luckily only in tests), a benchmark calling a wrong function, typos, shadowing issues and scope issues to bad coding style / formatting issues.

This PR also serves as a preparation for adding better linters to our CI pipeline.

Checklist

  • [x] Code compiles correctly
  • [x] All tests passing

julienschmidt avatar Aug 14 '20 17:08 julienschmidt

LGTM.

But 0ea749dd seems too strict to me. I usually use this variable hiding. Which linter do you want to use?

methane avatar Aug 16 '20 02:08 methane

According to the documentation comment of converter.ConvertValue(),

ConvertValue mirrors the reference/default converter in database/sql/driver with one exception

I think alignment with driver.defaultConverter.ConvertValue() is more important than coding style consistency here, so fixes in that method seems overdoing to me.

If these changes are merged, it will be difficult to check what is changed from reference implementation.

maku693 avatar Aug 16 '20 08:08 maku693

@julienschmidt It would be better to resubmit each lint error fix as separate MR. It would be easier to review and accept at least some of them.

dolmen avatar Jun 02 '23 12:06 dolmen