We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02b1f60 commit 9fc80a1Copy full SHA for 9fc80a1
utils/table_printer.go
@@ -22,7 +22,7 @@ func NewTablePrinter(w io.Writer) *TTYTablePrinter {
22
out: w,
23
IsTTY: tty,
24
maxWidth: ttyWidth,
25
- colWidths: []int{},
+ colWidths: make(map[int]int),
26
colFuncs: make(map[int]func(string) string),
27
}
28
@@ -31,14 +31,11 @@ type TTYTablePrinter struct {
31
out io.Writer
32
IsTTY bool
33
maxWidth int
34
- colWidths []int
+ colWidths map[int]int
35
colFuncs map[int]func(string) string
36
37
38
func (t *TTYTablePrinter) SetContentWidth(col, width int) {
39
- if col == len(t.colWidths) {
40
- t.colWidths = append(t.colWidths, 0)
41
- }
42
if width > t.colWidths[col] {
43
t.colWidths[col] = width
44
0 commit comments