From 4a723a3f50d9c919fe37d693a3390dd76e3693fb Mon Sep 17 00:00:00 2001 From: Artem Sidorenko Date: Tue, 19 Mar 2019 23:04:23 +0100 Subject: [PATCH] Use stderr for progress information Like this blog post describes, it's a unix convention: https://monkey.org/~marius/unix-tools-hints.html Signed-off-by: Artem Sidorenko --- cli/commands/generate/generate.go | 6 +++--- cli/commands/generate/generate_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/commands/generate/generate.go b/cli/commands/generate/generate.go index 5a0e622..697dc95 100644 --- a/cli/commands/generate/generate.go +++ b/cli/commands/generate/generate.go @@ -39,8 +39,8 @@ import ( // Stdout references the Stdout writer for generate command var Stdout io.Writer = os.Stdout // nolint: gochecknoglobals -// ProgressStdout references the Stdout writer for progress information -var ProgressStdout io.Writer = os.Stdout // nolint: gochecknoglobals +// ProgressWriter references the writer for progress information +var ProgressWriter io.Writer = os.Stderr // nolint: gochecknoglobals // Generate implements the CLI subcommand generate func Generate(ctx *cli.Context) error { // nolint: gocyclo @@ -210,7 +210,7 @@ func getConnectorData( // invoke the progress printer printProgress( - ctx, ProgressStdout, + ctx, ProgressWriter, ctagscounter, cmaxtags, cissuescounter, cmaxissues, cmrscounter, cmaxmrs) diff --git a/cli/commands/generate/generate_test.go b/cli/commands/generate/generate_test.go index 6599ba2..d836daf 100644 --- a/cli/commands/generate/generate_test.go +++ b/cli/commands/generate/generate_test.go @@ -252,7 +252,7 @@ func TestGenerate(t *testing.T) { // nolint: gocyclo // avoid progress output progressOutput := &bytes.Buffer{} - generate.ProgressStdout = progressOutput + generate.ProgressWriter = progressOutput testconnector.RetTestingTag = true testconnector.RepositoryExistsFail = tt.repositoryExistsFail