MCPcopy Index your code
hub / github.com/cortexproject/cortex / writeComment

Method writeComment

tools/doc-generator/writer.go:87–98  ·  view source on GitHub ↗
(comment string, indent int)

Source from the content-addressed store, hash-verified

85}
86
87func (w *specWriter) writeComment(comment string, indent int) {
88 if comment == "" {
89 return
90 }
91
92 wrapped := strings.TrimSpace(wordwrap.WrapString(comment, uint(maxLineWidth-indent-2)))
93 lines := strings.SplitSeq(wrapped, "\n")
94
95 for line := range lines {
96 w.out.WriteString(pad(indent) + "# " + line + "\n")
97 }
98}
99
100func (w *specWriter) string() string {
101 return strings.TrimSpace(w.out.String())

Callers 1

writeConfigEntryMethod · 0.95

Calls 2

padFunction · 0.85
WriteStringMethod · 0.80

Tested by

no test coverage detected