DEV Community

Jack Prescott
Jack Prescott

Posted on

Introducing Marten โ€“ The Go Web Framework Where Nothing Gets In Your Way

Hey Go community ๐Ÿ‘‹

If youโ€™ve ever felt that:

  • Gin is great but the custom context wrapping makes things leak into your business logic
  • Chi is beautifully minimal but you end up pulling in 5โ€“10 extra middleware packages anyway
  • You just want something clean, fast, and zero external dependencies

โ€ฆthen I built Marten exactly for that feeling.

What is Marten?

Marten is a minimalist Go web framework with one core philosophy:

"The framework you reach for when you want nothing in the way."

It gives you:

  • Ergonomic handler helpers (c.JSON, c.Bind, c.Param, c.Query, etc.)
  • Full stdlib compatibility โ€“ real context.Context is untouched at c.Request.Context()
  • Zero external dependencies โ€“ just net/http + Go stdlib
  • Built-in production middleware suite (no extra imports needed):
    • gzip compression (with pooling)
    • CORS (configurable, secure wildcard handling)
    • Secure headers (HSTS, XSS-Protection, CSP, etc.)
    • Rate limiting
    • Timeout
    • Body limit
    • Basic auth
    • Request ID
    • No-cache
    • ETag
    • Panic recovery
    • Logger

All applied via clean global/group/route-level chaining.

Quick Hello World

package main

import "github.com/gomarten/marten"

func main() {
    app := marten.New()

    app.GET("/", func(c *marten.Ctx) error {
        return c.JSON(200, map[string]string{"message": "Hello from Marten! ๐Ÿš€"})
    })

    // Add middleware in one line
    app.Use(marten.Middleware.Recover, marten.Middleware.Logger, marten.Middleware.Compress())

    app.Run(":8080")
}
Enter fullscreen mode Exit fullscreen mode

Why Another Framework?

Because sometimes you want:

  • Gin-like productivity without the custom context baggage
  • Chi-like purity with more batteries included
  • The confidence that your app will compile and behave the same 5 years from now (no dependency hell)

Try It Out

go get github.com/gomarten/marten
Enter fullscreen mode Exit fullscreen mode

Repo: https://github.com/gomarten/marten

Docs & examples are still growing, but the code is small (~2k LOC) and very easy to read.

Would love to hear your thoughts:

  • Do you prefer zero deps even if it means slightly more explicit code?
  • What's your current favorite Go web stack in 2026?

Happy coding! ๐Ÿพ

Top comments (0)