AtExit will register function to be executed before exit.
(f func())
| 110 | |
| 111 | // AtExit will register function to be executed before exit. |
| 112 | func AtExit(f func()) { |
| 113 | atExitFuncs = append(atExitFuncs, f) |
| 114 | } |
| 115 | |
| 116 | // Exit will run all exit funcs and then return with exitStatus |
| 117 | func Exit() { |