Source

atexit /

Filename Size Date modified Message
53 B
1.1 KB
221 B
646 B
1.5 KB
1.3 KB

About

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).

Example usage

package main

import (
    "atexit"
    "fmt"
)

func handler() {
    fmt.Println("Exiting")
}

func main() {
        atexit.Register(handler)
        atexit.Exit(0)
}

Install

goinstall bitbucket.org/tebeka/atexit