From Source to Service
Ship a static binary
Lesson 5 of 5
CGO_ENABLED=0 gives you one self-contained file, GOOS/GOARCH cross-compiles it anywhere, embed bakes in your assets, and systemd plus Caddy runs it for real.
What you'll learn
- Build a fully static binary with CGO_ENABLED=0 and cross-compile with GOOS/GOARCH
- Bake static assets into the binary with //go:embed
- Run it in production under systemd, behind a Caddy reverse proxy
Members only
A free account unlocks this lesson and every other one.
Runnable challenges, knowledge checks, and progress that syncs across your devices. No card needed.
Not sure yet? Try the free lesson first: A real HTTP service