Skip to content

Commit

Permalink
Print error to stderr instead of stdout before exiting (#2823)
Browse files Browse the repository at this point in the history
fix: fmt.Println prints error to stdout before exiting which is against Unix
principles.
  • Loading branch information
anoop142 committed Nov 16, 2023
1 parent 401616b commit 66f24c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/executor/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 66f24c9

Please sign in to comment.