Mizu is a lightweight web framework for Go. The name means βwaterβ in Japanese, reflecting the frameworkβs goal: to flow naturally with Goβs standard library rather than replacing it.
What is Mizu?
Mizu helps you build web servers and APIs in Go. If youβve used Pythonβs Flask, Nodeβs Express, or Rubyβs Sinatra, Mizu fills a similar role but stays closer to how Go works. A web framework handles the repetitive parts of building HTTP servers:- Routing: Matching URLs like
/users/123to your code - Request handling: Reading data from forms, JSON bodies, and URLs
- Response writing: Sending back JSON, HTML, or files
- Middleware: Running shared code (logging, auth) before handlers
What makes Mizu different?
Mizu adds a thin layer over Goβsnet/http package instead of replacing it:
| Feature | What it does | Why it matters |
|---|---|---|
| Go 1.22 ServeMux patterns | Routes like /users/{id} with path parameters | Uses the standard library, not a custom router |
| Context wrapper | c.JSON(), c.Query(), c.Param() helpers | Less boilerplate, cleaner handlers |
| Error returns | Handlers return errors directly | Central error handling, simpler code |
| Graceful shutdown | Finishes active requests before stopping | Safe deployments without dropped connections |
| Structured logging | Uses Goβs slog package | JSON logs for production, readable logs for development |
net/http, you already understand how Mizu works.
Who is Mizu for?
Mizu is a good fit if you:- Know Go basics and want to build web APIs
- Prefer explicit code over βmagicβ conventions
- Want to use standard library patterns, not framework-specific ones
- Need a small, focused tool rather than a full-stack framework
A quick taste
Hereβs a complete Mizu server in 15 lines:- Visiting
http://localhost:3000/returns βHello, Mizu!β as plain text - Visiting
http://localhost:3000/users/42returns{"user_id":"42"}as JSON - Pressing Ctrl+C stops the server gracefully
Get started
Quick Start
Build your first app in five minutes.
Why Mizu
Understand the design philosophy.
Features
See what Mizu provides.
Concepts
Learn how routing, handlers, and middleware work.