Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


Package macaron is a high productive and modular web framework in Go.

Subscribe to updates I use macaron

Statistics on macaron

Number of watchers on Github 2263
Number of open issues 17
Average time to close an issue 27 days
Main language Go
Average time to merge a PR 4 days
Open pull requests 4+
Closed pull requests 8+
Last commit almost 2 years ago
Repo Created over 5 years ago
Repo Last Updated almost 2 years ago
Size 404 KB
Homepage https://go-macaro...
Organization / Authorgo-macaron
Page Updated
Do you use macaron? Leave a review!
View open issues (17)
View macaron activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating macaron for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Macaron Build Status

Macaron Logo

Package macaron is a high productive and modular web framework in Go.

Getting Started

The minimum requirement of Go is 1.3.

To install Macaron:

go get

The very basic usage of Macaron:

package main

import ""

func main() {
    m := macaron.Classic()
    m.Get("/", func() string {
        return "Hello world!"


  • Powerful routing with suburl.
  • Flexible routes combinations.
  • Unlimited nested group routers.
  • Directly integrate with existing services.
  • Dynamically change template files at runtime.
  • Allow to use in-memory template and static files.
  • Easy to plugin/unplugin features with modular design.
  • Handy dependency injection powered by inject.
  • Better router layer and less reflection make faster speed.


Middlewares allow you easily plugin/unplugin features for your Macaron applications.

There are already many middlewares to simplify your work:

  • render - Go template engine
  • static - Serves static files
  • gzip - Gzip compression to all responses
  • binding - Request data binding and validation
  • i18n - Internationalization and Localization
  • cache - Cache manager
  • session - Session manager
  • csrf - Generates and validates csrf tokens
  • captcha - Captcha service
  • pongo2 - Pongo2 template engine support
  • sockets - WebSockets channels binding
  • bindata - Embed binary data as static and template files
  • toolbox - Health check, pprof, profile and statistic services
  • oauth2 - OAuth 2.0 backend
  • authz - ACL/RBAC/ABAC authorization based on Casbin
  • switcher - Multiple-site support
  • method - HTTP method override
  • permissions2 - Cookies, users and permissions
  • renders - Beego-like render engine(Macaron has built-in template engine, this is another option)
  • piwik - Server-side piwik analytics

Use Cases

  • Gogs: A painless self-hosted Git Service
  • Grafana: The open platform for beautiful analytics and monitoring
  • Peach: A modern web documentation server
  • Go Walker: Go online API documentation
  • Switch: Gopm registry
  • Critical Stack Intel: A 100% free intel marketplace from Critical Stack, Inc.

Getting Help



This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.

macaron open issues Ask a question     (View All Issues)
  • about 3 years Value not found for type *context.Context
  • over 3 years 平滑升级需求
  • over 3 years No Content-Length in ctx.ServeFile method
  • over 3 years 这两个模板引擎速度更快,无闻你看看能不能搞成中间件~
  • almost 4 years PANIC: reflect: call of reflect.Value.Interface on zero Value
  • almost 4 years Implement HTTP HEAD method correctly
  • almost 4 years 能否增加支持兼容其它路由处理机制的功能
  • about 4 years jwt contrib add
  • over 4 years 类似sessionauth的东西
  • over 4 years 能否增加SSE支持
  • almost 5 years Hope for Swagger support
  • almost 5 years Generators
  • about 5 years Able to register routes with a route table(file)
  • about 5 years 建议增加一个支付宝或财付通或者神马微信支付的中间件
macaron open pull requests (View All Pulls)
  • integration FastInvoke Handler
  • Add Content-Length in ServeFile when Content-Encoding is not null
  • Add ETag header to staticHandler
  • https support
macaron list of languages used
Other projects in Go