Marten¶
The framework you reach for when you want nothing in the way.
Fast. Simple. Elegant. Zero dependencies.
-
Quick to Start
Get up and running in seconds with a minimal, intuitive API that feels like writing pure Go.
-
Blazing Fast
Radix tree router, context pooling, and zero allocations where it matters. Built for performance.
-
Middleware Ready
13 built-in middleware for logging, auth, CORS, rate limiting, compression, and more.
-
Zero Dependencies
Only Go's standard library. No external dependencies means no supply chain risks.
Quick Example¶
package main
import "github.com/gomarten/marten"
func main() {
app := marten.New()
app.GET("/", func(c *marten.Ctx) error {
return c.OK(marten.M{"message": "Hello, Marten!"})
})
app.Run(":3000")
}
That's it. No boilerplate. No configuration files. Just code.
Features¶
Performance¶
Marten performs on par with Gin and Echo while maintaining zero dependencies.
| Benchmark | Marten | Gin | Echo | Chi |
|---|---|---|---|---|
| Static Route | 1464 ns/op | 1336 ns/op | 1436 ns/op | 2202 ns/op |
| Param Route | 1564 ns/op | 1418 ns/op | 1472 ns/op | 2559 ns/op |
| JSON Response | 1755 ns/op | 2050 ns/op | 1835 ns/op | 1868 ns/op |
Benchmarks run on Intel Xeon Platinum 8259CL @ 2.50GHz, Go 1.24
Context Pooling
Marten uses sync.Pool to reuse context objects, minimizing garbage collection pressure under high load.
Installation¶
Requires Go 1.22 or later.
Why Marten?¶
Most Go web frameworks grow until they become the problem they set out to solve. Marten stays small on purpose.
-
Minimal
~1000 lines of code. Easy to read, understand, and contribute to.
-
Explicit
No magic. No reflection. No struct tags for routing. What you see is what you get.
-
Composable
Middleware, groups, and handlers compose naturally. Build complex apps from simple pieces.
-
Idiomatic
Feels like writing Go, not fighting it. Uses standard library patterns throughout.
What Marten Does Not Do¶
These are intentional omissions:
- ❌ No ORM
- ❌ No template engine
- ❌ No CLI tools
- ❌ No code generation
- ❌ No reflection magic
- ❌ No struct tags for routing
- ❌ No global state
- ❌ No opinionated project structure
If you need these features, there are excellent libraries that do them well. Marten focuses on being the best routing and middleware layer.
Next Steps¶
-
Install Marten and build your first app
-
Learn the core concepts in depth
-
See complete, working examples
-
Detailed API documentation
License¶
MIT License. Use it however you want.