MCPcopy Index your code
hub / github.com/coder/coder / boundText

Function boundText

coderd/x/chatd/chatdebug/model.go:739–741  ·  view source on GitHub ↗

boundText truncates s to MaxMessagePartTextLength runes, appending an ellipsis if truncation occurs.

(s string)

Source from the content-addressed store, hash-verified

737// boundText truncates s to MaxMessagePartTextLength runes, appending
738// an ellipsis if truncation occurs.
739func boundText(s string) string {
740 return stringutil.Truncate(s, MaxMessagePartTextLength, stringutil.TruncateWithEllipsis)
741}
742
743// safeMarshalJSON marshals value to JSON. On failure it returns a
744// diagnostic error object rather than panicking, which is appropriate

Calls

no outgoing calls