Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
go2draft-error-handling-overview: Double io.Closer calls #27750
The examples in https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md arrange for w.Close() to be called more than once. https://golang.org/pkg/io/#Closer says
The text before the code, and the problem:
It's OK for the double-Close to be one of the faults with the 'before', but it would be nice if the improved 'after' version didn't also do it. The more robust version with more helpful errors would be one in between doesn't.