From cec49a42bdfc119927cf998dc9b9cb75f37eb312 Mon Sep 17 00:00:00 2001 From: Dan Farino Date: Wed, 25 Sep 2024 18:11:33 -0700 Subject: [PATCH] fix string formatting when format contains a percent sign but no args --- output.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/output.go b/output.go index f451e10..4714480 100644 --- a/output.go +++ b/output.go @@ -93,7 +93,10 @@ func (p *OutputProcessor) colorize(text string, colorName string) string { } func (p *OutputProcessor) colorizef(colorName string, format string, a ...interface{}) string { - var text = fmt.Sprintf(format, a...) + var text = format + if len(a) > 0 { + text = fmt.Sprintf(format, a...) + } if p.colorSchema != nil { if value, ok := (*p.colorSchema)[colorName]; ok {