go-kanna/kanna
Kanna
Go code generators built on the standard library — DI, struct mapping, test fixtures, ORM. Each works on its own and emits plain Go with no runtime reflection.
3stars
go-kanna/kanna
Kanna
Go code generators for DI, struct mapping, test fixtures, ORM, and i18n. Emits plain Go code with no runtime reflection.
Visit project- First shared
- Aug 20, 2026
- HN activity
- 30
Show HN@mickamyAug 20, 2026
Show HN: Kanna – Go generators for DI, queries, internationalization and more
I kept writing constructor wiring up, domain types and API types conversions, test fixtures, DB row scans, bra-bra-brah by my hands. I know that libraries those use reflections may help, but they fails on runtime and we cannot see what is happening without reading code. So I decided to create a project in oposite hand. Generate code and put it in our repository. The code is ordinary Go code, so that we can review, watch diffs and also debug it. For instance, when we have the following code, func NewDB() DB { return &DB{} } func NewUser(db DB) User { return User{db: db} } type Container struct { User User `di:""` } it generates... func NewContainer() *Container { db := NewDB() user := NewUser(db) return &Container{User: user} } No providers, just scan packages and find them. There are 5 generators. 1. DI 2. Struct to struct mapping (for protubf and so on) 3. Test fixtures (from model to them) 4. SQL queries (like an sqlc but without SQL and more like GORM) 5. Type safe i18n All we need is just a struct and tags. Project is just started and just hit v0.0.1. Any feedbacks are very welcome.
Community