Shipping Go: From Source to Service
The sequel to Go for TypeScript Developers. The primer taught you to read Go — types, errors-as-values, interfaces, goroutines. This course teaches you to ship it: build a real HTTP service on net/http with Go 1.22 routing, lay out a module the way Go projects expect, persist to SQLite through database/sql, test it with table tests and httptest, then compile a single static binary and put it behind systemd and a reverse proxy. By the end you'll have the full path from `go mod init` to a service running on a Linux box.
5 lessons · ~2 hours
1. From Source to Service
A real HTTP service
Go's net/http is production-grade out of the box — Go 1.22's ServeMux routes by method and path, and handlers are closures over their dependencies.
Project layout, modules & tooling
go.mod replaces package.json, cmd/ holds your binaries, internal/ is compiler-enforced privacy, and gofmt/go vet/staticcheck keep the repo honest.
SQLite persistence
database/sql is the standard interface, the driver choice is cgo speed vs pure-Go portability, and a versioned migration runner is twenty lines.
Testing Go services
go test is built in — table-driven tests with t.Run subtests are the house style, httptest exercises real handlers, and coverage is one flag away.
Ship a static binary
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.