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