truncate 截断字符串
(s string, maxLen int)
| 710 | |
| 711 | // truncate 截断字符串 |
| 712 | func truncate(s string, maxLen int) string { |
| 713 | if len(s) <= maxLen { |
| 714 | return s |
| 715 | } |
| 716 | return s[:maxLen] + "..." |
| 717 | } |
| 718 | |
| 719 | // generateEventID 生成事件 ID |
| 720 | func generateEventID() string { |
no outgoing calls
no test coverage detected