MCPcopy Create free account
hub / github.com/cli/cli / indentProblems

Function indentProblems

script/ghmock/report.go:183–193  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
183func 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
195func printOutput(w io.Writer, label, text string) {
196 fmt.Fprintf(w, "--- %s\n", label)

Callers 4

checkBeforeSaveFunction · 0.85
scaffoldGraphQLFunction · 0.85
scaffoldMethod · 0.85
printProblemsFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected