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

Function write

__tests__/go-promoted-dispatch.test.ts:357–360  ·  view source on GitHub ↗
(rel: string, content: string)

Source from the content-addressed store, hash-verified

355 it('moves the link between the promoted method and the struct\'s own', async () => {
356 dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-go-promoted-sync-'));
357 const write = (rel: string, content: string) => {
358 fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true });
359 fs.writeFileSync(path.join(dir, rel), content);
360 };
361 const wrap = 'package wrap\n\nimport "example.com/app/base"\n\ntype Wrapper struct {\n\tbase.Base\n}\n\nfunc (Wrapper) Name() string { return "" }\n';
362 write('go.mod', 'module example.com/app\n\ngo 1.22\n');
363 write('api/api.go', 'package api\n\ntype NamedCloser interface {\n\tClose() error\n\tName() string\n}\n');

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected