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

Function goJSONRawStructFields

scripts/codegen/go.ts:1519–1533  ·  view source on GitHub ↗
(propNames: string[])

Source from the content-addressed store, hash-verified

1517}
1518
1519function goJSONRawStructFields(propNames: string[]): Map<string, string> {
1520 const fieldNames = new Map<string, string>();
1521 const used = new Set<string>();
1522 for (const propName of [...new Set(propNames)].sort()) {
1523 const baseName = toGoFieldName(propName) || "Field";
1524 let fieldName = baseName;
1525 let suffix = 2;
1526 while (used.has(fieldName)) {
1527 fieldName = `${baseName}${suffix++}`;
1528 }
1529 used.add(fieldName);
1530 fieldNames.set(propName, fieldName);
1531 }
1532 return fieldNames;
1533}
1534
1535function pushGoJSONRawStructDeclLines(
1536 lines: string[],

Callers 1

Calls 3

toGoFieldNameFunction · 0.85
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…