Skip to content

Commit

Permalink
Use print instead of printf to fix #126
Browse files Browse the repository at this point in the history
  • Loading branch information
arinto committed Oct 4, 2019
1 parent 75270cc commit ec5152c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (rp *ReportPrinter) Print(format string) error {
return err
}

return rp.printf(buf.String())
return rp.print(buf.String())
case "json", "pretty":
rep, err := json.Marshal(*rp.Report)
if err != nil {
Expand All @@ -58,16 +58,16 @@ func (rp *ReportPrinter) Print(format string) error {
}
rep = out.Bytes()
}
return rp.printf(string(rep))
return rp.print(string(rep))
case "html":
buf := &bytes.Buffer{}
templ := template.Must(template.New("tmpl").Funcs(tmplFuncMap).Parse(htmlTmpl))
if err := templ.Execute(buf, *rp.Report); err != nil {
return err
}
return rp.printf(buf.String())
return rp.print(buf.String())
case "influx-summary":
return rp.printf(rp.getInfluxLine())
return rp.print(rp.getInfluxLine())
case "influx-details":
return rp.printInfluxDetails()
default:
Expand Down Expand Up @@ -239,8 +239,8 @@ func (rp *ReportPrinter) getInfluxFields() string {
return strings.Join(s, ",")
}

func (rp *ReportPrinter) printf(s string, v ...interface{}) error {
_, err := fmt.Fprintf(rp.Out, s, v...)
func (rp *ReportPrinter) print(s string) error {
_, err := fmt.Fprint(rp.Out, s)
return err
}

Expand Down

0 comments on commit ec5152c

Please sign in to comment.