From 5e7b1f6bfe3e5fc340fc9320f2dbd2966b2144b5 Mon Sep 17 00:00:00 2001 From: anqiansong Date: Tue, 17 May 2022 09:42:18 +0800 Subject: [PATCH] Fix process blocking problem during check (#1911) --- tools/goctl/env/check.go | 6 +++--- tools/goctl/util/console/console.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/goctl/env/check.go b/tools/goctl/env/check.go index af800fde..685d0193 100644 --- a/tools/goctl/env/check.go +++ b/tools/goctl/env/check.go @@ -83,7 +83,7 @@ command 'goctl env check --install' to install it, for details, please execute c install() continue } - log.Info("[goctl-env]: do you want to install %q [y: YES, n: No]", e.name) + console.Info("[goctl-env]: do you want to install %q [y: YES, n: No]", e.name) for { var in string fmt.Scanln(&in) @@ -94,10 +94,10 @@ command 'goctl env check --install' to install it, for details, please execute c brk = true case strings.EqualFold(in, "n"): pending = false - log.Info("[goctl-env]: %q installation is ignored", e.name) + console.Info("[goctl-env]: %q installation is ignored", e.name) brk = true default: - log.Error("[goctl-env]: invalid input, input 'y' for yes, 'n' for no") + console.Error("[goctl-env]: invalid input, input 'y' for yes, 'n' for no") } if brk { break diff --git a/tools/goctl/util/console/console.go b/tools/goctl/util/console/console.go index 726a3f71..998dbec0 100644 --- a/tools/goctl/util/console/console.go +++ b/tools/goctl/util/console/console.go @@ -175,7 +175,7 @@ func println(msg interface{}) { fmt.Println(msg) } -var defaultConsole = new(colorConsole) +var defaultConsole = &colorConsole{enable: true} func Success(format string, a ...interface{}) { defaultConsole.Success(format, a...)