(s string, n int)
| 13 | var navItems = []string{"Pricing", "History", "Settings"} |
| 14 | |
| 15 | func truncate(s string, n int) string { |
| 16 | if len(s) <= n { |
| 17 | return s |
| 18 | } |
| 19 | if n <= 3 { |
| 20 | return s[:n] |
| 21 | } |
| 22 | return s[:n-3] + "..." |
| 23 | } |
| 24 | |
| 25 | // lineCount returns the number of terminal lines in s. |
| 26 | func lineCount(s string) int { |
no outgoing calls
no test coverage detected