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

Function pushGoJSONRawStructUnmarshalLines

scripts/codegen/go.ts:1550–1562  ·  view source on GitHub ↗
(
    lines: string[],
    rawExpr: string,
    structVar: string,
    propNames: string[],
    indent: string
)

Source from the content-addressed store, hash-verified

1548}
1549
1550function pushGoJSONRawStructUnmarshalLines(
1551 lines: string[],
1552 rawExpr: string,
1553 structVar: string,
1554 propNames: string[],
1555 indent: string
1556): Map<string, string> {
1557 const fieldNames = pushGoJSONRawStructDeclLines(lines, structVar, propNames, indent);
1558 lines.push(`${indent}if err := json.Unmarshal(${rawExpr}, &${structVar}); err != nil {`);
1559 lines.push(`${indent}\treturn false`);
1560 lines.push(`${indent}}`);
1561 return fieldNames;
1562}
1563
1564function goJSONPathVarName(varPrefix: string, path: string[]): string {
1565 return `${varPrefix}${path.map(toGoFieldName).join("")}`;

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…