logoalt Hacker News

anttiharjutoday at 2:21 AM1 replyview on HN

defer isn't bullet proof either. I think there's a linter about it and os.Exit.

One can just wrap os.Exit in a helper to get the expected behaviour.


Replies

Joker_vDtoday at 2:29 AM

Also, if you pull the power plug, neither finally blocks nor defers would run. I personally consider it a clear and obvious deficiency in the semantics (and the implementations) of those programming languages but everybody refuses to listen to me.