(w io.Writer, label, text string)
| 193 | } |
| 194 | |
| 195 | func printOutput(w io.Writer, label, text string) { |
| 196 | fmt.Fprintf(w, "--- %s\n", label) |
| 197 | if text == "" { |
| 198 | fmt.Fprintln(w, "(empty)") |
| 199 | return |
| 200 | } |
| 201 | text = showEscapes(text) |
| 202 | fmt.Fprint(w, text) |
| 203 | if !strings.HasSuffix(text, "\n") { |
| 204 | fmt.Fprintln(w) |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | // showEscapes writes the escape character as \e, so color codes such as |
| 209 | // \e[33m stay visible in reports and a missing reset can be spotted. |
no test coverage detected