News for hackers. Stuff that matters.
Re:JVM exceptions are weird: a decompiler perspective by Joker_vD on Wednesday November 19, 2025 @10:09AM (#45980491)
Go's "defer" can't prevent return from actually returning from the function. Most of the time, it can't change the computed return value either, unless you go out of your way and use named return values. Go's "defer" also can't do crimes with "break" and "continue".

So Go's "defer" has more "and also do some things on the way out" semantics than "you suddenly forget why you were going to leave the kitchen, so you don't".

There are no comments on this comment yet.