Skip to content

Commit cec49a4

Browse files
committed
fix string formatting when format contains a percent sign but no args
1 parent 6efe12a commit cec49a4

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)