Skip to content

Commit

Permalink
replace 3 dots with ellipsis (prometheus#3072)
Browse files Browse the repository at this point in the history
Signed-off-by: charlie4284 <charlie4284@gmail.com>

Signed-off-by: charlie4284 <charlie4284@gmail.com>
Signed-off-by: Yijie Qin <qinyijie@amazon.com>
  • Loading branch information
yanksyoon authored and qinxx108 committed Dec 13, 2022
1 parent 5a7f398 commit 664e022
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion notify/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func Truncate(s string, n int) (string, bool) {
if n <= 3 {
return string(r[:n]), true
}
return string(r[:n-3]) + "...", true
return string(r[:n-1]) + "", true
}

// TmplText is using monadic error handling in order to make string templating
Expand Down
6 changes: 3 additions & 3 deletions notify/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestTruncate(t *testing.T) {
{
in: "abcde",
n: 4,
out: "a...",
out: "abc…",
trunc: true,
},
{
Expand All @@ -58,7 +58,7 @@ func TestTruncate(t *testing.T) {
{
in: "abcdefgh",
n: 5,
out: "ab...",
out: "abcd…",
trunc: true,
},
{
Expand All @@ -70,7 +70,7 @@ func TestTruncate(t *testing.T) {
{
in: "a⌘cdef",
n: 5,
out: "a⌘...",
out: "a⌘cd…",
trunc: true,
},
}
Expand Down

0 comments on commit 664e022

Please sign in to comment.