truncate ensures the string fits within the specified width
(text string, width int)
| 101 | |
| 102 | // truncate ensures the string fits within the specified width |
| 103 | func truncate(text string, width int) string { |
| 104 | if len(text) > width { |
| 105 | return text[:width] |
| 106 | } |
| 107 | return text |
| 108 | } |
| 109 | |
| 110 | // wrapText ensures the text wraps to the next line if it exceeds the column width |
| 111 | func wrapText(text string, width int) string { |
no outgoing calls
no test coverage detected