Documentation navigation
Anybuild documentation

Go

Detect a Go module, compile its server entrypoint, and run the resulting binary.

Detection

A project is detected as Go when go.mod or go.sum exists. Anybuild searches common server files including main.go, server.go, serve.go, api.go, and web.go, including supported nested layouts.

Build output

The selected source file determines a normalized serve binary name. If discovery cannot find an entrypoint, set ANYBUILD_GO_BUILD_FILE explicitly.

Configuration

VariablePurposeExample value
ANYBUILD_GO_VERSIONGo package version; current default is 1.25.5.1.25.5
ANYBUILD_GO_BUILD_FILEThe Go server entry file to compile.cmd/server/main.go
ANYBUILD_GO_SERVE_BINARYThe output binary name to run.server