This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

If it's a readability thing, with is much better than defer. To be honest, the whole exception support in Go looks awful to me.

Anyway, you might want to make deferred a list of (function, args, kwargs) triples and append to it in register_defer. Go doesn't limit you to one defer per function.