paint-brush
On Golang’s `defer` keywordby@tejasmanohar
2,248 reads
2,248 reads

On Golang’s `defer` keyword

by Tejas Manohar3mAugust 27th, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://golang.org/" target="_blank">Golang</a> has a <a href="https://blog.golang.org/defer-panic-and-recover" target="_blank"><em>defer</em> keyword</a>, which “defers” the execution of a function until the surrounding <a href="https://hackernoon.com/tagged/function" target="_blank">function</a> returns. Multiple <em>defer</em>s are stacked <a href="https://en.wikipedia.org/wiki/Stack_%28abstract_data_type%29" target="_blank">last-in first-out</a> so that the most recently <em>defer</em>red function is run first.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - On Golang’s `defer` keyword
Tejas Manohar HackerNoon profile picture
Tejas Manohar

Tejas Manohar

@tejasmanohar

L O A D I N G
. . . comments & more!

About Author

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite