Programming Languages

What is the purpose of the `defer` statement in Go?

Medium
7
Added
The `defer` statement is used to ensure that a function call is performed later in a program’s execution, typically for cleanup actions.