Go

Detected from go.mod. The newest published toolchain compiles the app.

See Buildpacksfor how detection and version policy work.

Detects

go.mod in the base directory.

Versions

Default is Go 1.26. Published toolchains as of September 2026 include 1.25-1.27. Go on Nodion always uses the newest published toolchain. An older go line in go.mod still builds.

The requested version is read from, in this order:

  • .go-version
  • The go directive in go.mod

The toolchain itself is not shipped in the run image. Only your binary is.

Install and build

go mod download when go.sum exists. Then:

  • Each subdirectory of cmd/ that contains .go files is built as its own binary.
  • If none, go build of . produces a binary named app.

Default CGO_ENABLED=0 and -ldflags=-s -w. Override with env CGO_ENABLED and GOFLAGS_LDFLAGS. Native libraries you need at compile time go in an Aptfile or project.toml.

Gin apps get GIN_MODE=release when that module is in go.sum.

Start command

Default web is the binary named server, api, web, or app if one of those was built, otherwise the first. Extra cmd/ binaries become extra process types. Override with a Procfile. Listen on PORT.