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

Function goPrimitiveUnionValueName

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

Source from the content-addressed store, hash-verified

2482}
2483
2484function goPrimitiveUnionValueName(member: JSONSchema7, ctx: GoCodegenCtx): string | undefined {
2485 const resolved = resolveGoUnionMember(member, ctx.definitions);
2486 if (resolved.enum || resolved.const !== undefined) return undefined;
2487
2488 if (resolved.type === "array") {
2489 const items = resolved.items && typeof resolved.items === "object" && !Array.isArray(resolved.items)
2490 ? resolved.items as JSONSchema7
2491 : undefined;
2492 if (!items) return undefined;
2493 const itemName = goPrimitiveSchemaTypeName(items, ctx);
2494 return itemName ? `${itemName}Array` : undefined;
2495 }
2496
2497 return goPrimitiveSchemaTypeName(resolved, ctx);
2498}
2499
2500function goPrimitiveUnionGoType(member: JSONSchema7, ctx: GoCodegenCtx): string | undefined {
2501 const resolved = resolveGoUnionMember(member, ctx.definitions);

Callers 2

goPrimitiveUnionVariantsFunction · 0.85
goUntaggedUnionVariantFunction · 0.85

Calls 2

resolveGoUnionMemberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…