Skip to content

Instantly share code, notes, and snippets.

@jd-boyd
Created March 22, 2023 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jd-boyd/7d599c9b50307c1421ade5acb4f353b1 to your computer and use it in GitHub Desktop.
Save jd-boyd/7d599c9b50307c1421ade5acb4f353b1 to your computer and use it in GitHub Desktop.
import (
"os"
"os/signal"
)
func setupExitHandler() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
jww.INFO.Println("Program killed!")
//cleanup()
os.Exit(1)
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment