MCPcopy
hub / github.com/colbymchenry/codegraph / goHandlerIdent

Function goHandlerIdent

src/resolution/callback-synthesizer.ts:1517–1522  ·  view source on GitHub ↗

Tail ident of a handler arg: `gin.Logger()`→`Logger`, `mw`→`mw`; null for string paths / closures.

(expr: string)

Source from the content-addressed store, hash-verified

1515}
1516/** Tail ident of a handler arg: `gin.Logger()`→`Logger`, `mw`→`mw`; null for string paths / closures. */
1517function goHandlerIdent(expr: string): string | null {
1518 const cleaned = expr.trim().replace(/\(\s*\)$/, ''); // drop a trailing call ()
1519 if (!cleaned || cleaned.startsWith('"') || cleaned.startsWith('`') || cleaned.startsWith('func')) return null;
1520 const m = cleaned.match(/(?:\.|^)([A-Za-z_]\w*)$/);
1521 return m ? m[1]! : null;
1522}
1523
1524function ginMiddlewareChainEdges(queries: QueryBuilder, ctx: ResolutionContext): Edge[] {
1525 // 1. Find the chain dispatcher(s): a Go method that invokes a `handlers` slice by index.

Callers 1

ginMiddlewareChainEdgesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected