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

Function assertNoGoRpcSessionEventConflicts

scripts/codegen/go.ts:3662–3675  ·  view source on GitHub ↗
(rpcGeneratedTypeCode: string)

Source from the content-addressed store, hash-verified

3660}
3661
3662function assertNoGoRpcSessionEventConflicts(rpcGeneratedTypeCode: string): void {
3663 const duplicateTypes = collectGoTopLevelNames(rpcGeneratedTypeCode, "type")
3664 .filter((name) => rpcSessionEventTopLevelNames.types.has(name));
3665 const duplicateConsts = collectGoTopLevelNames(rpcGeneratedTypeCode, "const")
3666 .filter((name) => rpcSessionEventTopLevelNames.consts.has(name));
3667
3668 if (duplicateTypes.length > 0 || duplicateConsts.length > 0) {
3669 const details = [
3670 duplicateTypes.length > 0 ? `types: ${duplicateTypes.join(", ")}` : undefined,
3671 duplicateConsts.length > 0 ? `consts: ${duplicateConsts.join(", ")}` : undefined,
3672 ].filter(Boolean).join("; ");
3673 throw new Error(`Generated Go rpc package has duplicate session-event/API declarations (${details}). Shared definitions must be referenced once, not emitted twice.`);
3674 }
3675}
3676
3677async function generateSessionEvents(schemaPath?: string, apiSchema?: ApiSchema): Promise<void> {
3678 console.log("Go: generating session-events...");

Callers 1

generateRpcFunction · 0.85

Calls 2

collectGoTopLevelNamesFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…