(s string, maxLen int)
| 208 | } |
| 209 | |
| 210 | func TruncateString(s string, maxLen int) string { |
| 211 | if len(s) <= maxLen { |
| 212 | return s |
| 213 | } |
| 214 | return s[:maxLen] + "..." |
| 215 | } |
| 216 | |
| 217 | // TruncateToBytes caps a string at exactly maxBytes, preserving the leading |
| 218 | // content and appending a marker so the UI knows the value was clipped. |
no outgoing calls
no test coverage detected