4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 03:34:03 +00:00

Update dependencies (#975)

This commit is contained in:
Wim
2020-01-09 21:02:56 +01:00
committed by GitHub
parent b9354de8fd
commit 0f708daf2d
360 changed files with 72921 additions and 42691 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"io"
"strings"
"unicode/utf8"
)
// Print is for debugging. It prints a string representation of parsed
@ -63,11 +64,11 @@ func shortenString(s string, maxLen int) string {
if maxLen < 0 {
return s
}
if len(s) < maxLen {
if utf8.RuneCountInString(s) < maxLen {
return s
}
// add "..." to indicate truncation
return s[:maxLen-3] + "..."
// add "" to indicate truncation
return string(append([]rune(s)[:maxLen-3], '…'))
}
// get a short name of the type of v which excludes package name