Skip to content

Commit

Permalink
Merge pull request #205 from ns-dfarino/main
Browse files Browse the repository at this point in the history
fix string formatting when format contains a percent sign but no args
  • Loading branch information
HeavyWombat authored Jan 7, 2025
2 parents 57d5480 + cec49a4 commit 2d91e92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2d91e92

Please sign in to comment.