MCPcopy
hub / github.com/sammcj/gollama / truncate

Function truncate

helpers.go:103–108  ·  view source on GitHub ↗

truncate ensures the string fits within the specified width

(text string, width int)

Source from the content-addressed store, hash-verified

101
102// truncate ensures the string fits within the specified width
103func 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
111func wrapText(text string, width int) string {

Callers 2

parseAPIResponseFunction · 0.85
RenderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected