-
Notifications
You must be signed in to change notification settings - Fork 500
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
Closer errors are ignored. #614
Comments
@gregwebs you mean add a new function as follow func DeferClose(c io.Closer) {
if err := c.Close(); err != nil {
// log err
}
} is it right? |
Yes. |
At present, there is no need for this method. I will add it when needs it. |
The code doesn't make sense right now since it passes in a pointer to an error and then doesn't use the error. I would suggest putting a link to this issue at the current DeferClose function so that the code can be understood. |
I would like to remove the error pointer, directly to print error log when failed to close. the closing error should not expose to outside. |
Bug Report
In this commit the errors from
DeferClose
were all ignored. Its possible that we might decide we want to ignore all Closer errors (one option would be just to log them), but then we should have a different function that doesn't pass in an error param.Note that I currently have PRs #581 #618 open that moves this file (so changes to this file will have merge conflicts with it).
The text was updated successfully, but these errors were encountered: