このレッスンは、現在英語のみです。
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.
このレッスンは、現在英語のみです。
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.