roulette/cmd/utils.go
2022-09-09 14:14:54 -05:00

20 lines
249 B
Go

/*
Copyright © 2022 Seednode <seednode@seedno.de>
*/
package cmd
import (
"os"
)
type Exit struct{ Code int }
func HandleExit() {
if e := recover(); e != nil {
if exit, ok := e.(Exit); ok == true {
os.Exit(exit.Code)
}
panic(e)
}
}