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-17 00:03:51 +05:30 committed by GitHub
parent 401616bb38
commit 66f24c90f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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)
}