Hacker News new | past | comments | ask | show | jobs | submit login
Always Be Closing: The Tale of a Go Resource Leak (medium.com/square-corner-blog)
2 points by junke on Aug 7, 2017 | hide | past | favorite | 1 comment



> One is that Go’s conventions around not ignoring returned errors and cleanup functions exist for good reason and should not be casually ignored.

Murhpy's law. People are generally unreliable to ensure and maintain this kind of consistency. If every call to "A" requires a call to "B", try to offer an abstraction (sorry, bad choice of words)... a pragmatic way to deal with the whole "AB" thing as a single step, especially if you can do it in the same lexical scope (RAII, try-with, etc.).




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: