Git Mirror of https://bitbucket.org/tebeka/atexit
Simple atexit implementation for Go.
Note that you have to call atexit.Exit and not os.Exit to terminate your program (that is, if you want the atexit handlers to execute).
package main import ( "atexit" "fmt" ) func handler() { fmt.Println("Exiting") } func main() { atexit.Register(handler) atexit.Exit(0) }
goinstall bitbucket.org/tebeka/atexit
- Home
- https://bitbucket.org/tebeka/atexit
- Author
- Miki Tebeka <miki.tebeka@gmail.com>