MCPcopy Index your code
hub / github.com/github/copilot-sdk / goCommentLines

Function goCommentLines

scripts/codegen/go.ts:303–322  ·  view source on GitHub ↗
(text: string, indent = "", wrap = true)

Source from the content-addressed store, hash-verified

301}
302
303function goCommentLines(text: string, indent = "", wrap = true): string[] {
304 const prefix = `${indent}//`;
305 const lines: string[] = [];
306
307 for (const paragraph of text.split(/\r?\n/)) {
308 const trimmed = paragraph.trim();
309 if (trimmed.length === 0) {
310 lines.push(prefix);
311 continue;
312 }
313 const commentLines = wrap
314 ? wrapGoCommentText(trimmed).split("\n").map((wrappedLine: string) => wrappedLine.trim())
315 : [trimmed];
316 for (const line of commentLines) {
317 lines.push(`${prefix} ${line}`);
318 }
319 }
320
321 return lines;
322}
323
324function wrapGeneratedGoComments(code: string): string {
325 return code

Callers 4

pushGoCommentFunction · 0.85
wrapGeneratedGoCommentsFunction · 0.85
generateRpcFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…