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

Function pushGoJSONNegativePropertyLines

scripts/codegen/go.ts:1650–1666  ·  view source on GitHub ↗
(
    lines: string[],
    structVar: string,
    fieldNames: Map<string, string>,
    properties: string[],
    indent: string,
    emitFinalReturn: boolean = false
)

Source from the content-addressed store, hash-verified

1648}
1649
1650function pushGoJSONNegativePropertyLines(
1651 lines: string[],
1652 structVar: string,
1653 fieldNames: Map<string, string>,
1654 properties: string[],
1655 indent: string,
1656 emitFinalReturn: boolean = false
1657): string | undefined {
1658 const propertyChecks = emitFinalReturn ? properties.slice(0, -1) : properties;
1659 for (const propName of propertyChecks) {
1660 lines.push(`${indent}if ${structVar}.${fieldNames.get(propName)!} != nil {`);
1661 lines.push(`${indent}\treturn false`);
1662 lines.push(`${indent}}`);
1663 }
1664 if (!emitFinalReturn || properties.length === 0) return undefined;
1665 return `${structVar}.${fieldNames.get(properties[properties.length - 1])!} == nil`;
1666}
1667
1668function pushGoJSONTargetedMatchSpecLines(
1669 lines: string[],

Callers 1

Calls 2

pushMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…