From 66f24c90f3688723281386affbfb344fee9426f2 Mon Sep 17 00:00:00 2001 From: Anoop S <40671157+anoop142@users.noreply.github.com> Date: Fri, 17 Nov 2023 00:03:51 +0530 Subject: [PATCH] Print error to stderr instead of stdout before exiting (#2823) fix: fmt.Println prints error to stdout before exiting which is against Unix principles. --- cmd/executor/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/executor/cmd/root.go b/cmd/executor/cmd/root.go index 90bf63a15..18494b910 100644 --- a/cmd/executor/cmd/root.go +++ b/cmd/executor/cmd/root.go @@ -454,7 +454,7 @@ func exit(err error) { // exits with the given error and exit code func exitWithCode(err error, exitCode int) { - fmt.Println(err) + fmt.Fprintln(os.Stderr, err) os.Exit(exitCode) }