MCPcopy Create free account
hub / github.com/celer-pkg/celer / truncate

Function truncate

pkgs/refs/output.go:10–15  ·  view source on GitHub ↗

truncate limits a string to maxLen characters, appending "..." if truncated.

(s string, maxLen int)

Source from the content-addressed store, hash-verified

8
9// truncate limits a string to maxLen characters, appending "..." if truncated.
10func truncate(s string, maxLen int) string {
11 if len(s) <= maxLen {
12 return s
13 }
14 return s[:maxLen-3] + "..."
15}
16
17// PrintResolvedRefs prints a formatted list of resolved refs to the terminal.
18func PrintResolvedRefs(projectName string, results []ResolvedRef) {

Callers 1

PrintResolvedRefsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected