一套面向有经验的开发者,帮助过渡到Go语言的成语级、生产级别的练习。
A set of Idiomatic prod-grade katas for experienced devs transitioning to Go

原始链接: https://github.com/MedUnes/go-kata

受布鲁斯·李专注练习的哲学启发,这个Go“每日Kata”仓库提供了一条独特的Go精通之路。它*不是*一个Go教程,而是一系列小型、集中的编码挑战,旨在培养地道的Go模式的流畅性——区分有效代码和真正*Go风格*代码的细微之处。 这些Kata面向有经验但刚接触Go的开发者,帮助他们利用现有技能,同时快速适应Go生态系统中的最佳实践。每个Kata都专注于一个特定领域,例如并发、性能、HTTP、错误处理或测试。 这个过程包括阅读挑战、编写解决方案,然后将其与参考实现或核心模式进行比较,通过重复和专注的解决问题来强化正确的方法。目标是内化Go解决常见软件工程问题的特定方式。

一位开发者分享了他们过渡到Go语言的经验,并创建了一系列“kata”——小型、专注的编码练习,专为学习地道Go语言的经验丰富的程序员设计。与典型的教程不同,这些kata不提供解决方案,而是基于生产级别的Go最佳实践,定义清晰的“通过/失败”标准。 该创建者发现,编写*正确*的Go代码与编写*地道*的Go代码之间存在差距,重点关注上下文取消、goroutine管理、HTTP客户端使用和文件系统处理等领域。目标是通过有意识的练习来避免常见的生产陷阱。 该项目托管在GitHub上 ([github.com/medunes](https://github.com/medunes)),正在积极寻求反馈,特别是来自具有生产经验的Go开发者,以完善和改进约束条件。初步评论指出缺少LICENSE文件,以及希望提供参考实现和自动化测试。
相关文章

原文

"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)

  • Go is simple to learn, but nuanced to master. The difference between "working code" and "idiomatic code" often lies in details such as safety, memory efficiency, and concurrency control.

  • This repository is a collection of Daily Katas: small, standalone coding challenges designed to drill specific Go patterns into your muscle memory.

  • This is not intended to teach coding, nor to use Go as a general-purpose learning vehicle. It is not intended to teach Go in general.

  • The focus should be, as much as possible, on challenging oneself to solve common software engineering problems the Go way.

  • Several seasoned developers spend years learning and applying best practices in production-grade contexts. When they decide to switch to Go, they often face two challenges:

    • Is there a way to transfer knowledge so that I don’t have to throw away years of experience and start from zero?

    • If yes, which parts should I focus on to recognize mismatches and use them the expected way in the Go ecosystem?

  1. Pick a Kata: Navigate to any XX-kata-yy folder.
  2. Read the Challenge: Open the README.md inside that folder. It defines the goal, the constraints, and the "idiomatic patterns" you must use.
  3. Solve It: Initialize a module inside the folder and write your solution.
  4. Reflect: Compare your solution with the provided "Reference Implementation" (if available) or the core patterns listed.

Please refer to the CONTRIBUTING file

01) Context, Cancellation, and Fail-Fast Concurrency

Real-world concurrency patterns that prevent leaks, enforce backpressure, and fail fast under cancellation.


02) Performance, Allocation, and Throughput

Drills focused on memory efficiency, allocation control, and high-throughput data paths.


03) HTTP and Middleware Engineering

Idiomatic HTTP client/server patterns, middleware composition, and production hygiene.


04) Errors: Semantics, Wrapping, and Edge Cases

Modern Go error handling: retries, cleanup, wrapping, and infamous pitfalls.


05) Filesystems, Packaging, and Deployment Ergonomics

Portable binaries, testable filesystem code, and dev/prod parity.


06) Testing and Quality Gates

Idiomatic Go testing: table-driven tests, parallelism, and fuzzing.

联系我们 contact @ memedata.com