MCPcopy Create free account
hub / github.com/compozy/agh / writeHumanTableRow

Function writeHumanTableRow

internal/cli/format.go:273–284  ·  view source on GitHub ↗
(builder *strings.Builder, row []string, widths []int)

Source from the content-addressed store, hash-verified

271}
272
273func writeHumanTableRow(builder *strings.Builder, row []string, widths []int) {
274 for column, cell := range row {
275 if column > 0 {
276 builder.WriteString(" ")
277 }
278 builder.WriteString(cell)
279 if column < len(row)-1 && column < len(widths) {
280 builder.WriteString(strings.Repeat(" ", max(0, widths[column]-humanTableCellWidth(cell))))
281 }
282 }
283 builder.WriteByte('\n')
284}
285
286func humanTableCellWidth(cell string) int {
287 return utf8.RuneCountInString(cell)

Callers 1

renderHumanTableFunction · 0.85

Calls 1

humanTableCellWidthFunction · 0.85

Tested by

no test coverage detected