Skip to content

Commit f2b0cd1

Browse files
authored
Merge pull request #90 from liamg/fix-color-trim
fix: Panic in color.Trim()
2 parents 6f9a6b1 + ae43819 commit f2b0cd1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/color/color.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ func Trim(input string, maxPrintableLength int) string {
106106
}
107107
}
108108

109+
if maxPrintableLength > len(input) {
110+
return input
111+
}
112+
109113
// Determine the end index for limiting printable content
110114
return input[:maxPrintableLength]
111115
}

0 commit comments

Comments
 (0)