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

Function emitGoAlias

scripts/codegen/go.ts:2949–2965  ·  view source on GitHub ↗
(typeName: string, schema: JSONSchema7, ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2947}
2948
2949function emitGoAlias(typeName: string, schema: JSONSchema7, ctx: GoCodegenCtx): void {
2950 if (ctx.generatedNames.has(typeName)) return;
2951 ctx.generatedNames.add(typeName);
2952
2953 const lines: string[] = [];
2954 if (schema.description) {
2955 pushGoCommentForContext(lines, schema.description, ctx);
2956 }
2957 if (isSchemaExperimental(schema)) {
2958 pushGoExperimentalTypeComment(lines, typeName, ctx);
2959 }
2960 if (isSchemaDeprecated(schema)) {
2961 pushGoCommentForContext(lines, `Deprecated: ${typeName} is deprecated and will be removed in a future version.`, ctx);
2962 }
2963 lines.push(`type ${typeName} ${resolveGoPropertyType(schema, typeName, "Value", true, ctx)}`);
2964 ctx.structs.push(lines.join("\n"));
2965}
2966
2967function emitGoRpcDefinition(definitionName: string, schema: JSONSchema7, ctx: GoCodegenCtx): string {
2968 const typeName = goDefinitionName(definitionName);

Callers 1

emitGoRpcDefinitionFunction · 0.85

Calls 8

pushGoCommentForContextFunction · 0.85
isSchemaExperimentalFunction · 0.85
isSchemaDeprecatedFunction · 0.85
resolveGoPropertyTypeFunction · 0.85
joinMethod · 0.80
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…