Ir para o conteúdo principal
0

Por enquanto, esta lição está em inglês.

Clean up, no matter what

Open a file, lock a mutex, start a timer: each needs a matching cleanup. defer lets you write the cleanup right next to the setup, and Go runs it when the function returns, whichever path it takes.