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

Function pushGoJSONPositiveTermLines

scripts/codegen/go.ts:1627–1648  ·  view source on GitHub ↗
(
    lines: string[],
    structVar: string,
    fieldNames: Map<string, string>,
    term: GoJSONMatchTerm,
    indent: string,
    varPrefix: string
)

Source from the content-addressed store, hash-verified

1625}
1626
1627function pushGoJSONPositiveTermLines(
1628 lines: string[],
1629 structVar: string,
1630 fieldNames: Map<string, string>,
1631 term: GoJSONMatchTerm,
1632 indent: string,
1633 varPrefix: string
1634): void {
1635 const propName = goJSONMatchPathProperty(term.path);
1636 const fieldExpr = `${structVar}.${fieldNames.get(propName)!}`;
1637 if (term.kind === "propertyExists") {
1638 lines.push(`${indent}if ${fieldExpr} == nil {`);
1639 lines.push(`${indent}\treturn false`);
1640 lines.push(`${indent}}`);
1641 return;
1642 }
1643
1644 lines.push(`${indent}if ${fieldExpr} == nil {`);
1645 lines.push(`${indent}\treturn false`);
1646 lines.push(`${indent}}`);
1647 pushGoJSONStringMatchLines(lines, fieldExpr, term.values, indent, varPrefix);
1648}
1649
1650function pushGoJSONNegativePropertyLines(
1651 lines: string[],

Callers 1

Calls 4

goJSONMatchPathPropertyFunction · 0.85
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…