Print error to stderr instead of stdout before exiting (#2823)

fix: fmt.Println prints error to stdout before exiting which is against Unix
principles.
This commit is contained in:
Anoop S
2023-11-16 10:33:51 -08:00
committed by GitHub
parent 401616bb38
commit 66f24c90f3
+1 -1
View File
@@ -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)
}