Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
Go advanced projects, Kafka, PostgreSQL
·
Module 4
Production Readiness: Testing, Logging, and Shutdown
1
Context Propagation for Application-wide Concerns
Use context propagation for request-scoped values, timeouts, and cancellation throughout the application.
2
Graceful Shutdown with Signals and Context
Implement graceful shutdown of the HTTP server using OS signal handling and context cancellation.
3
Structured Logging with slog and Tracing Middleware
Add structured logging using slog and middleware for request tracing.
Table-Driven Testing for Business Logic and Repositories
Write table-driven unit tests for business logic and repository implementations.
5
Mocking with Interfaces for Unit Testing
Use interfaces to create mock implementations for isolated unit testing.
6
Integrating PostgreSQL with testcontainers-go
Write integration tests against a real PostgreSQL instance using testcontainers-go.
7
Benchmarking Go Code
Benchmark critical code paths using Go's built-in benchmarking tools.
Previous module
Building a REST API with Swappable Storage
Next module
Building the Broker's Network Layer