Swift, but it is bound to narrower scopes, not just the function scope like Go. How does Nim scope defer statements?
In Nim, defer is a macro, that rewrites scope into "try: finally:" statement. 'finally' code block is always executed, even if there were any exceptions.