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

Function goMethodKey

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

* What a Go method matches an interface's method by: its name, and for an * unexported name the package that declares it as well. Go makes the * `refresh` declared in discovery/hetzner and the one declared in * discovery/aws two different methods, so neither satisfies the other's * interface. A

(m: Node)

Source from the content-addressed store, hash-verified

825 * that embedding promotes keeps the package of the type declaring it.
826 */
827function goMethodKey(m: Node): string {
828 if (GO_EXPORTED_NAME.test(m.name)) return m.name;
829 const file = m.filePath.replace(/\\/g, '/');
830 return `${file.slice(0, Math.max(file.lastIndexOf('/'), 0))}\0${m.name}`;
831}
832/**
833 * {@link goMethodKey} for a method of a standard-library type: its name, and
834 * for an unexported one (`testing.TB`'s `private`) the declaring package,

Callers 5

ownMethodsFunction · 0.85
ifaceMethodsFunction · 0.85
providesFunction · 0.85
goPromotionsFunction · 0.85
interfaceOverrideEdgesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected