The defer statement in Go actually comes in three flavors: open-coded, heap-allocated, and stack-allocated. Each has its own performance quirks and use cases.
Share this post
Go EP14: Heap-allocated Defer…
Share this post
The defer statement in Go actually comes in three flavors: open-coded, heap-allocated, and stack-allocated. Each has its own performance quirks and use cases.