MCPcopy Create free account
hub / github.com/astercloud/aster / truncateContent

Function truncateContent

examples/streaming/main.go:175–180  ·  view source on GitHub ↗
(content string, maxLen int)

Source from the content-addressed store, hash-verified

173}
174
175func truncateContent(content string, maxLen int) string {
176 if len(content) <= maxLen {
177 return content
178 }
179 return content[:maxLen] + "..."
180}
181
182// 性能对比示例
183

Callers 2

streamingExampleFunction · 0.85
collectExampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected