Browse Source

Merge pull request 'fix last truncate bug.' (#83) from fix-truncate into develop

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/83
pull/87/head
colorfulberry 4 years ago
parent
commit
51d935ce8e
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