Browse Source

TailMsgf must format with args

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 2 years ago
parent
commit
07c4849cb9
1 changed files with 4 additions and 4 deletions
  1. 4 4
      pkg/progress/plain.go

+ 4 - 4
pkg/progress/plain.go

@@ -53,12 +53,12 @@ func (p *plainWriter) Events(events []Event) {
 	}
 }
 
-func (p *plainWriter) TailMsgf(m string, args ...interface{}) {
-	prefix := ""
+func (p *plainWriter) TailMsgf(msg string, args ...interface{}) {
+	msg = fmt.Sprintf(msg, args...)
 	if p.dryRun {
-		prefix = api.DRYRUN_PREFIX
+		msg = api.DRYRUN_PREFIX + msg
 	}
-	fmt.Fprintln(p.out, append([]interface{}{prefix, m}, args...)...)
+	fmt.Fprintln(p.out, msg)
 }
 
 func (p *plainWriter) Stop() {