Go

Go 1.24's "tool" directive

Pin tool versions in Go 1.24 with the new 'tool' directive. Replace tools.go pattern with native go.mod support for project tooling.

Capturing console output in Go tests

Test functions that write to stdout/stderr in Go by capturing output with os.Pipe. Learn patterns to avoid deadlocks in concurrent tests.

Three flavors of sorting Go slices

Compare three Go slice sorting methods: sort.Interface, sort.Slice with closures, and modern generic slices.Sort with type safety.

Nil comparisons and Go interface

Debug tricky nil comparisons in Go interfaces. Understand dynamic types, type assertions, and use reflect for generic nil checking.

Go slice gotchas

Avoid common Go slice mistakes: shared backing arrays, nil vs empty slices, append behavior, and slice copying pitfalls explained.

Topological sort

Implement topological sorting in Go to order tasks by dependencies. Process directed acyclic graphs for build systems and scheduling.

Writing a circuit breaker in Go

Build a production-ready circuit breaker in Go from scratch with closed, open, and half-open states to prevent cascading failures.

ETag and HTTP caching

Implement client-side HTTP caching with ETag headers. Learn If-None-Match, 304 Not Modified responses, and weak validation in Go servers.

Crossing the CORS crossroad

Troubleshoot CORS errors with this practical guide. Learn Access-Control-Allow-Origin headers, preflight requests, and domain allowlisting in Go.

Search and navigate

Navigate