Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`defer` mostly makes sense when there's multiple exit paths (returns) or if there's a chance any of the code panics. Neither is the case in this instance, so just doing it like that is fine. There is also a slight overhead for deferring, as it needs to allocate some memory on the heap


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

Search: