(rpcGeneratedTypeCode: string)
| 3660 | } |
| 3661 | |
| 3662 | function 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 | |
| 3677 | async function generateSessionEvents(schemaPath?: string, apiSchema?: ApiSchema): Promise<void> { |
| 3678 | console.log("Go: generating session-events..."); |
no test coverage detected
searching dependent graphs…