From 9f2d52aae24d8c4f5c65a252cedfe16a3f2e0bc9 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 22 Aug 2024 17:15:00 -0400 Subject: [PATCH] fix: lint issues --- style.go | 4 ++-- table/table.go | 4 ++-- table/util.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/style.go b/style.go index 4343d3cd..2aba56b0 100644 --- a/style.go +++ b/style.go @@ -562,14 +562,14 @@ func pad(str string, n int, style *termenv.Style) string { return b.String() } -func max(a, b int) int { //nolint:unparam +func max(a, b int) int { //nolint:unparam,predeclared if a > b { return a } return b } -func min(a, b int) int { +func min(a, b int) int { //nolint:predeclared if a < b { return a } diff --git a/table/table.go b/table/table.go index a512ec55..f5a084b5 100644 --- a/table/table.go +++ b/table/table.go @@ -210,7 +210,7 @@ func (t *Table) Offset(o int) *Table { // String returns the table as a string. func (t *Table) String() string { - hasHeaders := t.headers != nil && len(t.headers) > 0 + hasHeaders := len(t.headers) > 0 hasRows := t.data != nil && t.data.Rows() > 0 if !hasHeaders && !hasRows { @@ -376,7 +376,7 @@ func (t *Table) computeWidth() int { // computeHeight computes the height of the table in it's current configuration. func (t *Table) computeHeight() int { - hasHeaders := t.headers != nil && len(t.headers) > 0 + hasHeaders := len(t.headers) > 0 return sum(t.heights) - 1 + btoi(hasHeaders) + btoi(t.borderTop) + btoi(t.borderBottom) + btoi(t.borderHeader) + t.data.Rows()*btoi(t.borderRow) diff --git a/table/util.go b/table/util.go index cd7c2b30..4d152aa7 100644 --- a/table/util.go +++ b/table/util.go @@ -13,7 +13,7 @@ func btoi(b bool) int { } // max returns the greater of two integers. -func max(a, b int) int { +func max(a, b int) int { //nolint:predeclared if a > b { return a } @@ -21,7 +21,7 @@ func max(a, b int) int { } // min returns the greater of two integers. -func min(a, b int) int { +func min(a, b int) int { //nolint:predeclared if a < b { return a }