Skip to content

Commit 2d91e92

Browse files
authored
Merge pull request #205 from ns-dfarino/main
fix string formatting when format contains a percent sign but no args
2 parents 57d5480 + cec49a4 commit 2d91e92

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

output.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ func (p *OutputProcessor) colorize(text string, colorName string) string {
9393
}
9494

9595
func (p *OutputProcessor) colorizef(colorName string, format string, a ...interface{}) string {
96-
var text = fmt.Sprintf(format, a...)
96+
var text = format
97+
if len(a) > 0 {
98+
text = fmt.Sprintf(format, a...)
99+
}
97100

98101
if p.colorSchema != nil {
99102
if value, ok := (*p.colorSchema)[colorName]; ok {

0 commit comments

Comments
 (0)