MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / goStdlibMethods

Function goStdlibMethods

src/resolution/go-stdlib-methods.ts:240–254  ·  view source on GitHub ↗
(importPath: string | null, typeName: string)

Source from the content-addressed store, hash-verified

238 * null. Undefined for a type this table does not know.
239 */
240export function goStdlibMethods(importPath: string | null, typeName: string): GoStdlibMethods | undefined {
241 if (importPath === null) return typeName === 'error' ? GO_ERROR_METHODS : undefined;
242 const key = `${importPath}.${typeName}`;
243 let methods = parsed.get(key);
244 if (methods === undefined) {
245 const listed = Object.prototype.hasOwnProperty.call(GO_STDLIB_METHODS, importPath)
246 ? GO_STDLIB_METHODS[importPath]![typeName]
247 : undefined;
248 methods = typeof listed === 'string'
249 ? new Map(listed.split(' ').map((entry) => entry.split(':') as [string, string]))
250 : null;
251 parsed.set(key, methods);
252 }
253 return methods ?? undefined;
254}

Callers 2

goImplementsEdgesFunction · 0.90
fakeTestingTBFunction · 0.90

Calls 4

callMethod · 0.80
mapMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by 1

fakeTestingTBFunction · 0.72