The Await method lets you delay exit until the process is interrupted.
package main
import "github.com/117/interrupt"
func main() {
// your goroutines and code here
interrupt.Await() // block until you ctrl + c
fmt.Println("caught interrupt, exiting safely")
// do your cleanup here
}