Section 8 of 11

defer

finally, but attached to a statement and scoped to the function.

LIFO order and argument evaluation

go.dev playground

Try it: The two prints differ: defer evaluates ARGUMENTS immediately, but a closure reads the variable at call time.