(str string, maxLen int)
| 325 | } |
| 326 | |
| 327 | func truncate(str string, maxLen int) string { |
| 328 | str = strings.Trim(str, " ") |
| 329 | |
| 330 | if len(str) < maxLen { |
| 331 | missing := maxLen - len([]rune(str)) |
| 332 | |
| 333 | return str + strings.Repeat(" ", missing) |
| 334 | } |
| 335 | |
| 336 | return str[:maxLen-3] + "..." |
| 337 | } |
| 338 | |
| 339 | func indent(text, indent string) string { |
| 340 | if text[len(text)-1:] == "\n" { |
no outgoing calls
no test coverage detected