(content string, maxLen int)
| 173 | } |
| 174 | |
| 175 | func truncateContent(content string, maxLen int) string { |
| 176 | if len(content) <= maxLen { |
| 177 | return content |
| 178 | } |
| 179 | return content[:maxLen] + "..." |
| 180 | } |
| 181 | |
| 182 | // 性能对比示例 |
| 183 |
no outgoing calls
no test coverage detected