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

Function emitGoUnionPlan

scripts/codegen/go.ts:2802–2823  ·  view source on GitHub ↗
(plan: GoUnionPlan, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2800}
2801
2802function emitGoUnionPlan(plan: GoUnionPlan, ctx: GoCodegenCtx): void {
2803 switch (plan.kind) {
2804 case "discriminated":
2805 emitGoFlatDiscriminatedUnion(plan.typeName, plan.discriminator, ctx, plan.description, isSchemaExperimental(plan.schema));
2806 return;
2807 case "requiredFieldDiscriminated":
2808 emitGoRequiredFieldDiscriminatedUnion(plan.typeName, plan.discriminator, ctx, plan.description, isSchemaExperimental(plan.schema));
2809 return;
2810 case "primitive":
2811 emitGoPrimitiveUnionInterface(plan.typeName, plan.schema, ctx, plan.variants);
2812 return;
2813 case "flattenedObject":
2814 emitGoFlattenedObjectUnion(plan.typeName, plan.variants, ctx, plan.description, isSchemaExperimental(plan.schema));
2815 return;
2816 case "untagged":
2817 emitGoUntaggedUnionInterface(plan.typeName, plan.schema, ctx, plan.variants);
2818 return;
2819 case "wrapper":
2820 emitGoUnionWrapperStruct(plan.typeName, plan.schema, ctx);
2821 return;
2822 }
2823}
2824
2825function goUnionPlanPropertyType(plan: GoUnionPlan, isRequired: boolean, hasNull: boolean): string {
2826 if (plan.kind === "flattenedObject" || plan.kind === "wrapper") {

Callers 3

resolveGoPropertyTypeFunction · 0.85
emitGoUnionStructFunction · 0.85
emitGoRpcDefinitionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…