MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / truncate

Function truncate

internal/tui/views/utils.go:15–23  ·  view source on GitHub ↗
(s string, n int)

Source from the content-addressed store, hash-verified

13var navItems = []string{"Pricing", "History", "Settings"}
14
15func 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.
26func lineCount(s string) int {

Callers 2

renderPriceTableMethod · 0.70
RenderMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected