Go Katas
“I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.”
(Bruce Lee)
Purpose of Go Katas
- Go is straightforward to learn, yet achieving mastery requires understanding its nuances. The distinction between functional code and truly idiomatic Go often involves aspects like safety, memory optimization, and effective concurrency management.
- This collection offers Daily Katas: concise, independent coding exercises crafted to embed specific Go patterns into a developer’s routine.
What These Katas Are Not
- These katas are not designed to teach general coding principles or to serve as an introductory Go course. They do not aim to teach Go from scratch.
- The primary objective is to challenge developers to solve typical software engineering problems using idiomatic Go practices.
- Experienced developers, after years of applying best practices in production environments, often encounter two main hurdles when transitioning to Go:
- How can existing knowledge be leveraged without starting over?
- Which specific Go ecosystem patterns and conventions should be prioritized to ensure a smooth transition and effective application of Go principles?
How to Engage with These Katas
- Select a Kata: Browse to any folder named XX-kata-yy.
- Review the Challenge: Open the README.md within that folder. This file outlines the objective, constraints, and the required idiomatic Go patterns.
- Develop Your Solution: Create a Go module within the folder and implement your code.
- Evaluate and Learn: Compare your solution against the provided “Reference Implementation” (if available) or the fundamental patterns specified.
Contribution Guidelines
For information on contributing, consult the CONTRIBUTING file.
Grouped Katas Index
01) Context, Cancellation, and Fail-Fast Concurrency
This section covers practical concurrency patterns designed to prevent resource leaks, manage backpressure, and enable rapid failure under cancellation conditions.
- 01 – The Fail-Fast Data Aggregator
- 03 – Graceful Shutdown Server
- 05 – Context-Aware Error Propagator
- 07 – The Rate-Limited Fan-Out Client
- 09 – The Cache Stampede Shield (singleflight TTL)
- 10 – Worker Pool with Backpressure and errors.Join
- 14 – The Leak-Free Scheduler
- 17 – Context-Aware Channel Sender (No Leaked Producers)
02) Performance, Allocation, and Throughput
Exercises focusing on memory efficiency, precise allocation control, and high-throughput data processing.
- 02 – Concurrent Map with Sharded Locks
- 04 – Zero-Allocation JSON Parser
- 11 – NDJSON Stream Reader (Long Lines)
- 12 – sync.Pool Buffer Middleware
03) HTTP and Middleware Engineering
Standard Go patterns for HTTP clients and servers, middleware composition, and maintaining production readiness.
04) Errors: Semantics, Wrapping, and Edge Cases
Modern Go error handling techniques, including retries, resource cleanup, error wrapping, and common pitfalls.
- 08 – Retry Policy That Respects Context
- 19 – The Cleanup Chain (defer + LIFO + Error Preservation)
- 20 – The “nil != nil” Interface Trap (Typed nil Errors)
05) Filesystems, Packaging, and Deployment Ergonomics
Practices for portable binaries, testable filesystem interactions, and ensuring consistency between development and production environments.
06) Testing and Quality Gates
Idiomatic Go testing methodologies, including table-driven tests, parallel execution, and fuzzing.

