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

multiWriteCloser.Close() has a bug. #10505

Closed
luhaosg opened this issue Dec 6, 2022 · 2 comments
Closed

multiWriteCloser.Close() has a bug. #10505

luhaosg opened this issue Dec 6, 2022 · 2 comments
Labels

Comments

@luhaosg
Copy link

luhaosg commented Dec 6, 2022

if closeErr := c.Close(); err != nil {

I think it need to fix as :

if closeErr := c.Close(); closeErr != nil {

func (m multiWriteCloser) Close() error {
	var err error
	for _, c := range m.closers {
		if closeErr := c.Close(); err != nil {
			err = closeErr
		}
	}
	return err
}
@bep
Copy link
Member

bep commented Dec 6, 2022

Thanks, good catch.

@bep bep closed this as completed in 5067775 Dec 6, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants