defer
Useful when for script like things where cleanup should be done on fail or sucess no matter. You can call defer many times to register many deferred functions that will all be called when the function exits in any state.
Useful when for script like things where cleanup should be done on fail or sucess no matter. You can call defer many times to register many deferred functions that will all be called when the function exits in any state.