diff options
| author | Jeff Carr <[email protected]> | 2025-10-30 14:03:30 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-30 14:03:30 -0500 |
| commit | 357b464107b520fae4ed064b3dac639b14105e1a (patch) | |
| tree | 78785aa9dec34de85392363acd29a37abe6fdb32 /humanTable.go | |
| parent | 57fa0dc00c8141c252c8ec452f8a34448315c33d (diff) | |
Diffstat (limited to 'humanTable.go')
| -rw-r--r-- | humanTable.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/humanTable.go b/humanTable.go index 17b84a1..caf0bba 100644 --- a/humanTable.go +++ b/humanTable.go @@ -30,7 +30,7 @@ func StandardTableRow(sizes []int, args []string) (string, string) { } fmts = append(fmts, sfmt) if len(args) > i { - val := args[i] + val := strings.Join(strings.Fields(args[i]), " ") // removes all newlines cell = fmt.Sprintf(sfmt, val) parts = append(parts, cell) } else { @@ -52,7 +52,8 @@ func StandardTableRow(sizes []int, args []string) (string, string) { // small = 0 // } } - return line[0:small], strings.Join(fmts, " ") + smalls := fmt.Sprintf("small=%d", small) + return line[0:small], strings.Join(fmts, " ") + " " + smalls } func StandardTableRowDebug(sizes []int, args []string) (string, string) { @@ -62,7 +63,8 @@ func StandardTableRowDebug(sizes []int, args []string) (string, string) { // cell = fmt.Sprintf(sfmt, val) } } - return StandardTableRow(sizes, args) + line, fmts := StandardTableRow(sizes, args) + return line, fmts } /* |
