Show HN: Kanna – Go generators for DI, queries, internationalization and more
Kanna is a new Go code-generation toolkit that automates DI wiring, struct mapping, test fixtures, SQL queries, and i18n — hitting v0.0.1 on Aug 20.
Kanna, a Go code-generation library authored by mickamy, published its v0.0.1 release on August 20, 2026. The project, posted to Hacker News as a Show HN, provides five code generators aimed at eliminating repetitive boilerplate in Go projects.
The toolkit ships five generators, per the GitHub repository: dependency injection (DI) container wiring, struct-to-struct mapping (targeting protobuf and similar conversions), test fixture generation from model definitions, SQL query generation described as similar to sqlc but without hand-written SQL and closer in style to GORM, and type-safe internationalization (i18n). In each case, the author writes, all that is needed is a struct definition and tags.
The DI generator illustrates the approach: given constructor functions such as NewDB() and NewUser(db *DB) alongside a Container struct annotated with di:"" tags, Kanna scans the package and emits an ordinary NewContainer() function that wires the dependencies in order — no runtime reflection, no provider registrations. The generated code is plain Go, intended to be committed to the repository so teams can review diffs, read the output directly, and step through it in a debugger.
The author's stated motivation, explained in the HN post, is a frustration with reflection-based libraries that fail at runtime and obscure what is happening inside them. By generating static code instead, Kanna trades runtime flexibility for compile-time visibility: errors surface earlier, and the generated output is auditable in version control like any other source file.
The project is explicitly described as just started, and the author is actively soliciting feedback. No production users, funding, or organizational backing are mentioned in the available sources. The repository lives under the go-kanna GitHub organization. The HN submission had one point and no comments at the time of publication.
No comments yet — start the thread.