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:
parent
401616bb38
commit
66f24c90f3
|
|
@ -454,7 +454,7 @@ func exit(err error) {
|
||||||
|
|
||||||
// exits with the given error and exit code
|
// exits with the given error and exit code
|
||||||
func exitWithCode(err error, exitCode int) {
|
func exitWithCode(err error, exitCode int) {
|
||||||
fmt.Println(err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue