From 83b0be1379fd5f6b62403e508547bc71248a2367 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 1 Jun 2025 16:58:29 -0400 Subject: [PATCH] Always hard exit in PrintError(); do not pointlessly return the error code in soft exit --- back/exitSoft.go | 4 ++-- other/general.go | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/back/exitSoft.go b/back/exitSoft.go index 81bd2d0..a070d19 100644 --- a/back/exitSoft.go +++ b/back/exitSoft.go @@ -3,6 +3,6 @@ package back // Exit (soft) is meant to be used in interactive implementations (GUIs/TUIs) to keep the program running after an operation. -func Exit(code int) int { - return code +func Exit(code int) { + return } diff --git a/other/general.go b/other/general.go index 3fdad2b..120b0ef 100644 --- a/other/general.go +++ b/other/general.go @@ -9,13 +9,8 @@ import ( // PrintError prints an error message in the MUTN format and exits with the specified exit code. // Requires: message (the error message to print), -// exitCode (the exit code to use), -// forceHardExit (if true, exit immediately; if false, allow soft exit for interactive clients). -func PrintError(message string, exitCode int, forceHardExit bool) { +// exitCode (the exit code to use) +func PrintError(message string, exitCode int) { fmt.Println(back.AnsiError + message + back.AnsiReset) - if forceHardExit { - os.Exit(exitCode) - } else { - back.Exit(exitCode) - } + os.Exit(exitCode) }