MCPcopy
hub / github.com/cilium/cilium / wrapString

Function wrapString

tools/dpgen/generate.go:255–264  ·  view source on GitHub ↗
(in, prefix string)

Source from the content-addressed store, hash-verified

253}
254
255func wrapString(in, prefix string) string {
256 var b strings.Builder
257 width := uint(80 - len(prefix))
258 for line := range strings.SplitSeq(wordwrap.WrapString(in, width), "\n") {
259 b.WriteString(prefix)
260 b.WriteString(line)
261 b.WriteString("\n")
262 }
263 return b.String()
264}
265
266// sentencify capitalizes the first letter of a string and adds a period at
267// the end if it doesn't already have one.

Callers 2

varsToStructFunction · 0.85
tagsToCommentFunction · 0.85

Calls 2

StringMethod · 0.65
WriteStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…