finds.dev← search

// the find

zenazn/goji

★ 3,644 · Go · MIT · updated Oct 2020

Goji is a minimalistic web framework for Golang that's high in antioxidants.

Goji is a minimalist, Sinatra-style HTTP router/framework for Go with net/http-compatible handlers and a threaded context object (web.C) for passing state through middleware. It's for people who want Martini-style ergonomics without the reflection magic, but the project is explicitly superseded by the author's own goji.io v2.

Zero reflection in the routing core, so there's no runtime magic to debug when a handler doesn't fire the way you expect. Routes are matched in registration order exactly like naively trying them one by one, which makes the router's behavior predictable and easy to reason about. Graceful shutdown and zero-downtime reload via Einhorn/systemd socket handoff is a real feature most minimal routers skip. The web.Handler interface lets it interop with plain http.Handler while still allowing a protocol upgrade when talking to another web.Handler, so you're not locked out of the ecosystem.

The README's first paragraph tells you not to use this project — goji.io is the maintained successor with the same author and similar semantics, which makes picking this over that a hard sell for any new code. Last push was October 2020, so five years with zero commits; any Go version drift or stdlib changes since then are untested. It predates context.Context (added in Go 1.7), so its own web.C context-threading mechanism is now the non-idiomatic way to do something the standard library already solves natively. Middleware and routing are split across separate packages (web, web/middleware) with their own learning curve, which undercuts the 'minimalistic' framing a bit.

View on GitHub →

// 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 →