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

Function detectGoEntrypoint

packages/go/src/entrypoint.ts:15–37  ·  view source on GitHub ↗
(
  workPath: string,
  configuredEntrypoint?: string
)

Source from the content-addressed store, hash-verified

13 * Checks the configured entrypoint first, then searches candidate locations.
14 */
15export async function detectGoEntrypoint(
16 workPath: string,
17 configuredEntrypoint?: string
18): Promise<string | null> {
19 // If the configured entrypoint exists, use it
20 if (
21 configuredEntrypoint &&
22 (await pathExists(join(workPath, configuredEntrypoint)))
23 ) {
24 debug(`Using configured Go entrypoint: ${configuredEntrypoint}`);
25 return configuredEntrypoint;
26 }
27
28 // Search candidate locations
29 for (const candidate of GO_CANDIDATE_ENTRYPOINTS) {
30 if (await pathExists(join(workPath, candidate))) {
31 debug(`Detected Go entrypoint: ${candidate}`);
32 return candidate;
33 }
34 }
35
36 return null;
37}
38
39/**
40 * Normalized entrypoint detector for Go services. Wraps {@link detectGoEntrypoint}

Callers 3

buildFunction · 0.90
startDevServerFunction · 0.90
detectEntrypointFunction · 0.85

Calls 1

debugFunction · 0.90

Tested by

no test coverage detected