From 86f3b9ffc7f91791c916e8c2e3ee4aa2d47337a5 Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Mon, 11 May 2020 13:43:14 -0500 Subject: [PATCH] Write cli errors to stderr This explicitly writes errors to stderr, for the benefit of the document plugin subcommand. This is needed so that errors are displayed to end users of kustomize, and can be used to debug manifest issues. When sent to stdout, the error message gets swallowed/hidden by kustomize. Change-Id: I49b668e5e71fbe4662fe3aec7bad4ebccadebd64 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 53620b3d9..6cbf6f900 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ func main() { } if err := rootCmd.Execute(); err != nil { - fmt.Fprintln(os.Stdout, err) + fmt.Fprintln(os.Stderr, err) os.Exit(1) } }