PR Buddy 16673 - fix(asciitable): Default maxCellLength to 0 if negative (#17777)

* fix(asciitable): Default maxCellLength to 0 if negative

* Run Goimports on modified file

Co-authored-by: Håkon Solbjørg <hakon@solbj.org>
This commit is contained in:
Noah Stride 2022-10-25 14:45:26 +01:00 committed by GitHub
parent 034ac9062a
commit 39f4bc3c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,7 +107,7 @@ func MakeTableWithTruncatedColumn(columnOrder []string, rows [][]string, truncat
for _, column := range columns {
if column.Title == truncatedColumn {
column.MaxCellLength = width - totalLen - len("... ")
column.MaxCellLength = max(width-totalLen-len("... "), 0)
}
t.AddColumn(column)
}