We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca77c86 commit ba9b695Copy full SHA for ba9b695
internal/txlib/utils.go
@@ -225,8 +225,8 @@ func truncateMessage(message string) string {
225
maxLength = 0
226
}
227
228
- if len(message) > maxLength {
229
- return message[:maxLength-2] + ".."
+ if len(message) > maxLength && maxLength > 0 {
+ return message[:maxLength] + ".."
230
231
return message
232
internal/txlib/utils_test.go
@@ -86,7 +86,7 @@ func TestTruncateMessage(t *testing.T) {
86
)
87
assert.Equal(
88
t,
89
- "this is a long message that needs to be truncated because it exceeds the max..",
+ "this is a long message that needs to be truncated because it exceeds the maxim..",
90
result,
91
92
0 commit comments