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

Function truncate

pkg/memory/quality_analyzer.go:483–488  ·  view source on GitHub ↗

truncate 截断字符串

(s string, maxLen int)

Source from the content-addressed store, hash-verified

481
482// truncate 截断字符串
483func truncate(s string, maxLen int) string {
484 if len(s) <= maxLen {
485 return s
486 }
487 return s[:maxLen] + "..."
488}

Callers 5

TestTruncateFunction · 0.70
detectContradictionsMethod · 0.70
detectDuplicatesMethod · 0.70
detectOutdatedMethod · 0.70
detectLowConfidenceMethod · 0.70

Calls

no outgoing calls

Tested by 1

TestTruncateFunction · 0.56