MCPcopy
hub / github.com/wavetermdev/waveterm / TruncateString

Function TruncateString

pkg/util/utilfn/utilfn.go:151–159  ·  view source on GitHub ↗
(s string, maxLen int)

Source from the content-addressed store, hash-verified

149}
150
151func TruncateString(s string, maxLen int) string {
152 if len(s) <= maxLen {
153 return s
154 }
155 if maxLen < 4 {
156 maxLen = 4
157 }
158 return s[:maxLen-3] + "..."
159}
160
161func LongestPrefix(root string, strs []string) string {
162 if len(strs) == 0 {

Callers 5

processToolCallFunction · 0.92
RunGeminiChatStepFunction · 0.92
parseAnthropicHTTPErrorFunction · 0.92
parseOpenAIHTTPErrorFunction · 0.92
debugPrintInputFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected