Go - Samples Index
Beginner 10/10
Teacher 10/10
Architect 10/10
What’s here
- Sample REST API — net/http, JSON, clean structure, testing/linting.
- Sample CRUD API (with Migrations) — database/sql, Postgres, migrations, Makefile, docker-compose.
- Sample gRPC Streaming Service — streaming RPC, interceptors, proto generation, client example.
- Samples Quickstart — one-page commands, plus an all-in-one docker-compose stack.
Prerequisites
- Go 1.22+
- Docker & Docker Compose
- Optional tools:
grpcurl
,protoc
+ plugins,golang-migrate
Recommended order
- Start with Sample REST API to see handlers, JSON, and structure.
- Move to CRUD + Migrations to add database and schema management.
- Explore gRPC Streaming for service-to-service communication.
- Use Quickstart to run everything quickly or spin up the observability stack.
Tips
- Check each sample’s Makefile to discover common tasks (run, test, lint, migrate).
- When running the CRUD sample, export
DSN
or use the defaultpostgres://user:pass@localhost:5432/app?sslmode=disable
. - For observability, start the Jaeger + OTel Collector compose, then set
OTEL_EXPORTER_OTLP_ENDPOINT
in your service.