-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Calling sql.db's Ping functiion returns error #83
Comments
it cannot return an error. |
I have found it to return an error on The error goes away when max idle connections is >0 |
yes that makes sense @mhemmings thanks for pointing it |
I've found another case where calling Ping causes errors. I used go-sqlmock by switching out the driver name in the Given that |
Reproducible code: Function to be tested:
Test:
But when the Ping is made the error is "connection refused" |
Your code does not use an sqlmock db in your http server function, instead it opens mysql. If you would not just defer close sqlmock db, but instead check if all expectations were met like all examples in API docs show. It would give you an error that ping was never called learn the library first, start from reading api docs and examples. |
@l3pp4rd Do we feel comfortable closing this issue? |
No description provided.
The text was updated successfully, but these errors were encountered: