Skip to content

Glossary: Go Beyond the Basics

defer

Also written: deferred

A keyword that schedules a function call to run when the surrounding function returns, however it returns. It is used for `cancel()`, `mu.Unlock()` and `ticker.Stop()`.

Where the book teaches it

Related terms

mutexrecover