Go

Notes on the Go programming language — interfaces, concurrency, testing, and patterns that have held up in production.

Retry function in Go

Build retry logic in Go without reflection using generics. Implement exponential backoff and configurable retry strategies with type safety.

Rate limiting via Nginx

Implement rate limiting at the infrastructure layer with Nginx reverse proxy. Protect Go services from DDoS with leaky bucket algorithm.

Reminiscing CGI scripts

Build a CGI script from scratch using Go's stdlib and Bash. Understand why Common Gateway Interface fell out of favor for modern web apps.

Configuring options in Go

Compare three Go option patterns: exposed structs, option constructors, and functional options. Learn when to use each for clean APIs.

Writing a TOTP client in Go

Build a TOTP-based 2FA client in Go using the standard library. Generate time-based one-time passwords like Google Authenticator.

Interface guards in Go

Use compile-time interface guards to verify type conformity in Go without runtime overhead. Learn the var _ Interface = (*Type)(nil) pattern.

Go structured logging with slog

Master Go 1.21's log/slog package for structured logging with levels, JSON output, and attribute grouping. No third-party libraries needed.