Shipping Go services means more than go build—configure timeouts, observability, CI, vulnerability scanning, and graceful shutdown for Kubernetes deployments.
Checklist
go build -ldflags="-s -w"for smaller binaries when appropriate- HTTP
ServerRead/Write/Idle timeouts—not defaults - Structured logging (
slog, zap, zerolog) with correlation IDs go test ./...and race detector-racein CIgovulncheckor dependency scanning in pipeline- Graceful shutdown on SIGTERM—drain connections before exit in K8s pods
- Pin module versions; run
go mod tidyin CI
Important interview questions and answers
- Q: Why graceful shutdown in Kubernetes?
A: SIGTERM precedes pod removal—finish in-flight requests before exit to avoid dropped traffic. - Q: Race detector?
A:go test -racefinds data races—run in CI for concurrent code paths.
Self-check
- Why set HTTP server timeouts?
- What tool checks known vulnerabilities in dependencies?
Track summary
You covered Go language fundamentals: syntax, types, structs, interfaces, concurrency, stdlib modules, JSON/HTTP patterns, generics, and interview context. Go's sweet spot is cloud-native services, DevOps tooling, and network backends with simple deployment.
Next steps
- Build a CLI with
flagor cobra locally - Write a small HTTP API with tests and graceful shutdown
- Read The Go Programming Language concurrency chapters
- Compare patterns with Rust, Java, and Node.js tracks
- Explore Kubernetes client-go or operator tutorials when ready
Tip: Run go test -race ./... in CI for concurrent code—this lesson also closes the track with summary and next steps.
Interview prep
- Graceful shutdown in K8s?
Handle SIGTERM—drain in-flight HTTP before exit when pod terminates.
- Race detector?
go test -racefinds data races—run in CI for concurrent code.