Skip to content
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

Connector implements io.Closer #184

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Conversation

shogo82148
Copy link
Owner

from Go 1.17, the DB.Close method closes the connector field.

https://tip.golang.org/doc/go1.17#database/sql
The DB.Close method now closes the connector field if the type in this field implements the io.Closer interface.

https://tip.golang.org/pkg/database/sql/driver/#Connector
If a Connector implements io.Closer, the sql package's DB.Close method will call Close and return error (if any).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 66.475% when pulling 1948651 on sql-connector-implements-closer into abcfd0a on main.

@shogo82148 shogo82148 merged commit add24dc into main Jul 2, 2021
@shogo82148 shogo82148 deleted the sql-connector-implements-closer branch July 2, 2021 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants