Skip to content

Commit

Permalink
Fix escape-string for colored output
Browse files Browse the repository at this point in the history
  • Loading branch information
Langvann committed Apr 29, 2021
1 parent e0b09d4 commit 0c37f07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/format/TemplateFormatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (tf *templateFormatter) WriteRecord(record interface{}) error {
}

func parseTemplate(templateString string) (*template.Template, error) {
ESC := fmt.Sprint(0x1b)
ESC := string(rune(0x1b))
funcMap := template.FuncMap{
"reset": func() string { return ESC + "[0m" },
"bold": func() string { return ESC + "[1m" },
Expand Down

0 comments on commit 0c37f07

Please sign in to comment.