MCPcopy Create free account
hub / github.com/devspace-sh/devspace / ReportToString

Function ReportToString

pkg/devspace/analyze/analyze.go:154–172  ·  view source on GitHub ↗

ReportToString transforms a report to a string

(report []*ReportItem)

Source from the content-addressed store, hash-verified

152
153// ReportToString transforms a report to a string
154func ReportToString(report []*ReportItem) string {
155 reportString := ""
156
157 if len(report) == 0 {
158 reportString += fmt.Sprintf("\n%sNo problems found.\n%sRun `%s` if you want show pod logs\n\n", paddingLeft, paddingLeft, ansi.Color("devspace logs --pick", "white+b"))
159 } else {
160 reportString += "\n"
161
162 for _, reportItem := range report {
163 reportString += createHeader(reportItem.Name, len(reportItem.Problems))
164
165 for _, problem := range reportItem.Problems {
166 reportString += problem + "\n"
167 }
168 }
169 }
170
171 return reportString
172}
173
174func createHeader(name string, problemCount int) string {
175 header := fmt.Sprintf(" %s (%d potential issue(s)) ", name, problemCount)

Callers 3

openURLFunction · 0.92
TestReportToStringFunction · 0.85
AnalyzeMethod · 0.85

Calls 1

createHeaderFunction · 0.85

Tested by 1

TestReportToStringFunction · 0.68