diff options
| author | Jeff Carr <[email protected]> | 2025-10-21 09:21:42 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-21 09:21:42 -0500 |
| commit | 64b29a3807917b6203b85d8f7f99ff622b947784 (patch) | |
| tree | e91ed93b48b55697f4aadc51ab9cc87508195216 /exit.go | |
| parent | 303064638637e8ab89313ace25b73fc02cb46408 (diff) | |
callbacks to argv Exit()
Diffstat (limited to 'exit.go')
| -rw-r--r-- | exit.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +package ENV + +import "os" + +// this is an experiment at this point to +// see how this turns out + +// argv normally sets these callbacks +// argv has timing set from when os.Args was parsed +func GoodExit(reason string, err error) { + if goodExit != nil { + goodExit(reason) + } + os.Exit(0) +} + +func BadExit(reason string, err error) { + if badExit != nil { + badExit(reason, err) + } + os.Exit(-1) +} |
