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

Function emitGoRpcDefinition

scripts/codegen/go.ts:2967–2990  ·  view source on GitHub ↗
(definitionName: string, schema: JSONSchema7, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2965}
2966
2967function emitGoRpcDefinition(definitionName: string, schema: JSONSchema7, ctx: GoCodegenCtx): string {
2968 const typeName = goDefinitionName(definitionName);
2969 const effectiveSchema = resolveObjectSchema(schema, ctx.definitions) ?? resolveSchema(schema, ctx.definitions) ?? schema;
2970
2971 if (isStringEnumDefinition(effectiveSchema)) {
2972 getOrCreateGoEnum(typeName, effectiveSchema.enum, ctx, effectiveSchema.description, getEnumValueDescriptions(effectiveSchema), isSchemaDeprecated(effectiveSchema), isSchemaExperimental(effectiveSchema));
2973 return typeName;
2974 }
2975
2976 if (isNamedGoObjectSchema(effectiveSchema)) {
2977 emitGoStruct(typeName, effectiveSchema, ctx);
2978 return typeName;
2979 }
2980
2981 const unionMembers = goNonNullUnionMembers(effectiveSchema);
2982 if (unionMembers.length > 0) {
2983 const plan = planGoUnion(typeName, effectiveSchema, ctx, true);
2984 if (plan) emitGoUnionPlan(plan, ctx);
2985 return typeName;
2986 }
2987
2988 emitGoAlias(typeName, effectiveSchema, ctx);
2989 return typeName;
2990}
2991
2992interface GoGeneratedTypeCode {
2993 typeCode: string;

Callers 3

resolveGoPropertyTypeFunction · 0.85
goUntaggedUnionVariantFunction · 0.85
generateGoRpcTypeCodeFunction · 0.85

Calls 14

goDefinitionNameFunction · 0.85
resolveObjectSchemaFunction · 0.85
resolveSchemaFunction · 0.85
isStringEnumDefinitionFunction · 0.85
getOrCreateGoEnumFunction · 0.85
getEnumValueDescriptionsFunction · 0.85
isSchemaDeprecatedFunction · 0.85
isSchemaExperimentalFunction · 0.85
isNamedGoObjectSchemaFunction · 0.85
emitGoStructFunction · 0.85
goNonNullUnionMembersFunction · 0.85
planGoUnionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…