From 4f48474c6826ae0f93135457cb712737c9897c3a Mon Sep 17 00:00:00 2001 From: palytoxin Date: Tue, 11 May 2021 16:50:33 +0800 Subject: [PATCH] fix last truncate bug. --- modules/base/tool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/base/tool.go b/modules/base/tool.go index ebbff8671..8145522e2 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -285,7 +285,7 @@ func Subtract(left interface{}, right interface{}) interface{} { // EllipsisString returns a truncated short string, // it appends '...' in the end of the length of string is too large. func EllipsisString(str string, length int) string { - if utf8.RuneCountInString(str) <= 3 { + if length <= 3 { return "..." } if utf8.RuneCountInString(str) <= length {