mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-10-04 01:37:49 +03:00
fix: lint issues
This commit is contained in:
parent
54950ba0b5
commit
9f2d52aae2
4
style.go
4
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
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user