MCPcopy Create free account
hub / github.com/vercel/vercel / writeEntrypoint

Function writeEntrypoint

packages/go/src/index.ts:737–750  ·  view source on GitHub ↗
(
  dest: string,
  goPackageName: string,
  goFuncName: string
)

Source from the content-addressed store, hash-verified

735}
736
737async function writeEntrypoint(
738 dest: string,
739 goPackageName: string,
740 goFuncName: string
741) {
742 const modMainGoContents = await readFile(
743 join(__dirname, '../main.go'),
744 'utf8'
745 );
746 const mainModGoContents = modMainGoContents
747 .replace('__VC_HANDLER_PACKAGE_NAME', goPackageName)
748 .replace('__VC_HANDLER_FUNC_NAME', goFuncName);
749 await writeFile(dest, mainModGoContents, 'utf-8');
750}
751
752/**
753 * Writes a `go.mod` file in the specified directory. If a `go.mod` file

Callers 2

buildHandlerWithGoModFunction · 0.85

Calls 2

replaceMethod · 0.80
readFileFunction · 0.50

Tested by

no test coverage detected