Skip to content

Commit 90fae3d

Browse files
committed
ipn/yegor: m refactor trunc8
1 parent 913078c commit 90fae3d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

intra/ipn/rpn/yegor.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,9 +1643,12 @@ func (a *WsClient) kid() string {
16431643

16441644
func trunc8(s string) string {
16451645
if len(s) <= 8 {
1646-
return s
1646+
return s[:4]
16471647
}
1648-
return s[:8] + "..."
1648+
if len(s) <= 16 {
1649+
return s[:4] + ".." + s[len(s)-4:]
1650+
}
1651+
return s[:8] + ".." + s[len(s)-8:]
16491652
}
16501653

16511654
func newWsGw(c *WsWgConfig, h *http.Client) (*WsClient, error) {

0 commit comments

Comments
 (0)