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

Function goPrimitiveUnionGoType

scripts/codegen/go.ts:2500–2514  ·  view source on GitHub ↗
(member: JSONSchema7, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2498}
2499
2500function goPrimitiveUnionGoType(member: JSONSchema7, ctx: GoCodegenCtx): string | undefined {
2501 const resolved = resolveGoUnionMember(member, ctx.definitions);
2502 if (resolved.enum || resolved.const !== undefined) return undefined;
2503
2504 if (resolved.type === "array") {
2505 const items = resolved.items && typeof resolved.items === "object" && !Array.isArray(resolved.items)
2506 ? resolved.items as JSONSchema7
2507 : undefined;
2508 if (!items) return undefined;
2509 const itemType = goPrimitiveSchemaGoType(items, ctx);
2510 return itemType ? `[]${itemType}` : undefined;
2511 }
2512
2513 return goPrimitiveSchemaGoType(resolved, ctx);
2514}
2515
2516function goPrimitiveUnionVariantTypeName(typeName: string, valueName: string): string {
2517 if (typeName.endsWith("FieldValue")) {

Callers 2

goPrimitiveUnionVariantsFunction · 0.85
goUntaggedUnionVariantFunction · 0.85

Calls 2

resolveGoUnionMemberFunction · 0.85
goPrimitiveSchemaGoTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…