Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtExit ¶
func AtExit(fn func())
AtExit runs the given function before the program exits, either naturally, or when a signal is received. In order to run the function on normal exit, Cleanup() should be called at the end of main(). common.Defer() is the canonical way to do this.
func Cleanup ¶
func Cleanup()
Cleanup cancels all tick functions registered via Repeat(), then waits for them to fully stop running and for their cleanup functions to run. Cleanup() runs automatically when SIGINT or SIGTERM is received. If your program runs interactively or is expected to exit normally under other circumstances, you should make sure Cleanup() is called at the end of main(). common.Defer() is the canonical way to do this.
Types ¶
This section is empty.