News for hackers. Stuff that matters.
Re:More Gotchas of Defer in Go, Part II by Groxx on Thursday December 21, 2017 @08:35PM (#15984604)
As long as you can always call .close() regardless of the code below, yep - that'd work, and is definitely more readable.

If you can't call it unless [some other conditions], it goes back to the same kind of problem though. "closable" may not be a good choice on my part, as they're often called unconditionally.

There are no comments on this comment yet.