Browse Source

fix last truncate bug.

pull/83/head
palytoxin 4 years ago
parent
commit
4f48474c68
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/base/tool.go

+ 1
- 1
modules/base/tool.go View File

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


Loading…
Cancel
Save