finds.dev← search

// the find

go-chi/chi

★ 22,131 · Go · MIT · updated Feb 2026

lightweight, idiomatic and composable router for building Go HTTP services

chi is a Go HTTP router built on a Patricia radix trie that stays 100% compatible with net/http. It adds route groups, sub-router mounting, inline middleware, and URL parameter extraction without introducing any external dependencies. Good fit for teams who want structured routing without committing to a full framework.

- Zero external dependencies and pure stdlib compatibility means any net/http middleware works without adapters — no ecosystem fragmentation.

- The Router interface is well-defined and exported, so you can swap implementations or mock in tests without rewriting handler signatures.

- Sub-router mounting and middleware scoping (r.Route, r.With, r.Group) make it genuinely easier to organize large codebases compared to plain ServeMux, without magic.

- docgen package that generates route documentation from the live router tree is a practical addition that most routers skip entirely.

- Benchmarks in the README are from November 2020 with Go 1.15 — Go 1.22+ introduced built-in pattern matching in net/http ServeMux with method routing, which closes the gap significantly and isn't acknowledged.

- URL parameters retrieved via chi.URLParam use context.Value internally, meaning a type-unsafe string lookup on every access; there's no generated or typed parameter binding.

- The Timeout middleware sets a context deadline but doesn't actually cancel in-flight writes or close connections — callers have to manually check ctx.Done(), which is easy to miss and the docs underemphasize this gotcha.

- middleware.Logger outputs plain text with no structured logging support built in; httplog is a separate package, so the default logging story is weak out of the box for anyone running in production.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →