indentProblems lists problems one per line. With a limit above zero, it shows at most that many and points to the log for the rest.
(problems []string, indent string, limit int)
| 181 | // indentProblems lists problems one per line. With a limit above zero, it |
| 182 | // shows at most that many and points to the log for the rest. |
| 183 | func indentProblems(problems []string, indent string, limit int) string { |
| 184 | var b strings.Builder |
| 185 | for i, p := range problems { |
| 186 | if limit > 0 && i == limit { |
| 187 | fmt.Fprintf(&b, "%s...and %d more; ghmock log --json shows them all\n", indent, len(problems)-i) |
| 188 | break |
| 189 | } |
| 190 | fmt.Fprintf(&b, "%s%s\n", indent, p) |
| 191 | } |
| 192 | return b.String() |
| 193 | } |
| 194 | |
| 195 | func printOutput(w io.Writer, label, text string) { |
| 196 | fmt.Fprintf(w, "--- %s\n", label) |
no test coverage detected