Targets · Go · Project setup

Project setup

Everything around the rendered code that makes a working, buildable Go module.

Contents

How a Program becomes Go, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.

The files

A rendered Go program is an ordinary Go module: a go.mod file and one package per top module, plus main.

my-app/
  go.mod                // module path + Go version
  main.go               // func main() { Program.Application(...) }
  reactive/             // the runtime package (Reactive + Context + drivers)
  ui/  maths/  ...       // one package per top module
// go.mod
module example.com/my-app

go 1.22

Build and run

The standard Go toolchain builds and runs it — no extra tooling.

go mod tidy            # resolve dependencies
go run .               # build and run
go build -o my-app .   # a standalone binary

The output is a single static binary, which is what makes Go a good fit for shipping a back-end service or a command-line tool built from a Program.