From 64b29a3807917b6203b85d8f7f99ff622b947784 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 21 Oct 2025 09:21:42 -0500 Subject: callbacks to argv Exit() --- exit.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 exit.go (limited to 'exit.go') diff --git a/exit.go b/exit.go new file mode 100644 index 0000000..6cf489f --- /dev/null +++ b/exit.go @@ -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) +} -- cgit v1.2.3