diff options
| author | Jeff Carr <[email protected]> | 2025-10-04 15:30:09 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-04 15:30:09 -0500 |
| commit | ec669a62c02da925dc5659d4525ff4eba05fae11 (patch) | |
| tree | ebaf5a2009dde9e763f8e514f0cdbb53d590a770 | |
| parent | 85885a09373e59c8a8ea0bfc015bee647182fd32 (diff) | |
smart exit function
| -rw-r--r-- | auto.proto | 2 | ||||
| -rw-r--r-- | exit.go | 20 |
2 files changed, 21 insertions, 1 deletions
@@ -28,5 +28,5 @@ message Auto { // `autogenpb:marshal` ` message Autos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:nomutex` string uuid = 1; // `autogenpb:uuid:94210ebf-a534-4b33-aadd-2f5e1f56ae38` string version = 2; // `autogenpb:version:v0.0.1` - repeated Auto autos = 3; // THIS MUST BE HttpRequest and then HttpRequests + repeated Auto autos = 3; } @@ -0,0 +1,20 @@ +package prep + +import ( + "os" + "time" + + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + +// initializes logging and command line options + +func (pb *Auto) BadExit(msg string, err error) { + if err != nil { + log.Info(err) + } + dur := time.Since(pb.Ctime.AsTime()) + log.Infof("%s: %s (%s)\n", pb.Argname, msg, shell.FormatDuration(dur)) + os.Exit(-1) +} |
