MCPcopy Create free account
hub / github.com/cloudfoundry/multiapps-cli-plugin / GetTableOutputLines

Function GetTableOutputLines

testutil/ui.go:8–18  ·  view source on GitHub ↗
(headers []string, rows [][]string)

Source from the content-addressed store, hash-verified

6)
7
8func GetTableOutputLines(headers []string, rows [][]string) []string {
9 const padding = 3
10 var lines []string
11 maxLen := make(map[int]int)
12 getMaxLen(headers, rows, maxLen)
13 lines = append(lines, getLine(headers, maxLen, padding))
14 for _, row := range rows {
15 lines = append(lines, getLine(row, maxLen, padding))
16 }
17 return lines
18}
19
20func getLine(row []string, maxLen map[int]int, padding int) string {
21 var line string

Calls 2

getMaxLenFunction · 0.85
getLineFunction · 0.85

Tested by

no test coverage detected