diff options
| author | Jeff Carr <[email protected]> | 2025-10-26 22:41:47 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-26 22:41:47 -0500 |
| commit | 4d0828def125f96d376cc1bd018bd3d8b0997901 (patch) | |
| tree | b683bbe08350c6e5b78eba65be9a6496091c874b /exit.go | |
| parent | 59c9500872620a0e43752d7ebf352804aaf49925 (diff) | |
rearranging filenames
Diffstat (limited to 'exit.go')
| -rw-r--r-- | exit.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -7,7 +7,7 @@ import "os" // argv normally sets these callbacks // argv has timing set from when os.Args was parsed -func GoodExit(reason string, err error) { +func GoodExit(reason string) { if goodExit != nil { goodExit(reason) } @@ -20,3 +20,12 @@ func BadExit(reason string, err error) { } os.Exit(-1) } + +func Exit(reason string, err error) { + if err == nil { + GoodExit(reason) + os.Exit(0) + } + BadExit(reason, err) + os.Exit(-1) +} |
