fix: lint issues

This commit is contained in:
Ayman Bagabas 2024-08-22 17:15:00 -04:00
parent 54950ba0b5
commit 9f2d52aae2
3 changed files with 6 additions and 6 deletions

View File

@ -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
}

View File

@ -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)

View File

@ -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
}