(plan: GoUnionPlan, ctx: GoCodegenCtx)
| 2800 | } |
| 2801 | |
| 2802 | function 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 | |
| 2825 | function goUnionPlanPropertyType(plan: GoUnionPlan, isRequired: boolean, hasNull: boolean): string { |
| 2826 | if (plan.kind === "flattenedObject" || plan.kind === "wrapper") { |
no test coverage detected
searching dependent graphs…