Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Aug 22, 2024
1 parent 54950ba commit 9f2d52a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions table/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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
}
return b
}

// 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
}
Expand Down

0 comments on commit 9f2d52a

Please sign in to comment.