From 0df207cb8304f5ab50fcafd35868b546019a7e59 Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 21 Feb 2020 16:36:51 +0100 Subject: [PATCH] util/common: add new line when printing to std out to avoid messages in the same line --- pkg/util/common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/common.go b/pkg/util/common.go index bba14da30d4..f8ccab40590 100644 --- a/pkg/util/common.go +++ b/pkg/util/common.go @@ -200,12 +200,12 @@ func Ask(question, expectedResponse string, retries int) (answer string, success attempts := 1 if retries < 0 { - fmt.Printf("Retries was set to a number less than zero (%d). Please specify a positive number of retries or zero, if you want to ask unconditionally.", retries) + fmt.Printf("Retries was set to a number less than zero (%d). Please specify a positive number of retries or zero, if you want to ask unconditionally.\n", retries) } for attempts <= retries { scanner := bufio.NewScanner(os.Stdin) - fmt.Printf("%s (%d/%d) ", question, attempts, retries) + fmt.Printf("%s (%d/%d) \n", question, attempts, retries) scanner.Scan() answer = scanner.Text() @@ -214,7 +214,7 @@ func Ask(question, expectedResponse string, retries int) (answer string, success return answer, true, nil } - fmt.Printf("Expected '%s', but got '%s'", expectedResponse, answer) + fmt.Printf("Expected '%s', but got '%s'\n", expectedResponse, answer) attempts++ }