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

Function goDiscriminatorValueExpr

scripts/codegen/go.ts:811–815  ·  view source on GitHub ↗
(value: GoDiscriminatorValue, enumName: string | undefined)

Source from the content-addressed store, hash-verified

809}
810
811function goDiscriminatorValueExpr(value: GoDiscriminatorValue, enumName: string | undefined): string {
812 if (typeof value === "boolean") return value ? "true" : "false";
813 if (!enumName) throw new Error(`Missing enum name for string discriminator value ${value}`);
814 return `${enumName}${goEnumConstSuffix(value)}`;
815}
816
817function schemaForConstValue(value: unknown): JSONSchema7 {
818 if (value === null) return { type: "null" };

Callers 1

Calls 1

goEnumConstSuffixFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…