HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
go-martini
martini
Go2013–2020
go-martini / martini

martini

Classy web framework for Go

19Distinct people
23Mentions
0Explicit recommenders
11.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Classy web framework for Go

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year23 dated mentions

Observed mentions: 2013-11-14 08:23:32 UTC to 2020-02-04 20:43:29 UTC.

0369122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 11 mentions; 0 submissions, 11 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC11011
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC716
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Martini NOTE: The martini framework is no longer maintained. Martini is a powerful package for quickly writing modular web applications/services in Golang. Language Translations: 繁體中文 简体中文 Português Brasileiro (pt_BR) Español 한국어 번역 Русский 日本語 French Turkish German Polski Getting Started After installing Go and setting up your GOPATH, create your first .go file. We'll call it server.go. package main import "github.com/go-martini/martini" func main() { m := martini.Classic() m.Get("/", func() string { return "Hello world!" }) m.Run() } Then install the Martini package (go 1.1 or greater is required): go get github.com/go-martini/martini Then run your server: go run server.go You will now have a Martini webserver running on localhost:3000. Getting Help Join the Mailing list Watch the Demo Video Ask questions on Stackoverflow using the martini tag GoDoc documentation Features Extremely simple to use. Non-intrusive design. Plays nice with other Golang packages. Awesome path matching and routing. Modular design - Easy to add functionality, easy to rip stuff out. Lots of good handlers/middlewares to use. Great 'out of the box' feature set. Fully compatible with the http.HandlerFunc interface. Default document serving (e.g., for serving AngularJS apps in HTML5 mode). More Middleware For more middleware and functionality, check out the repositories in the martini-contrib organization. Table of Contents Classic Martini Handlers Routing Services Serving Static Files Middleware Handlers Next() Martini Env FAQ Classic Martini To get up and running quickly, martini.Classic() provides some reasonable defaults that work well for most web applications: m := martini.Classic() // ... middleware and routing goes here m.Run() Below is some of the functionality martini.Classic() pulls in automatically: Request/Response Logging - martini.Logger Panic Recovery - martini.Recovery Static File serving - martini.Static Routing - martini.Router Handlers Handlers are the heart and soul of Martini. A handler is basically any kind of callable function: m.Get("/", func() { println("hello world") }) Return Values If a handler returns something, Martini will write the result to the current http.ResponseWriter as a string: m.Get("/", func() string { return "hello world" // HTTP 200 : "hello world" }) You can also optionally return a status code: m.Get("/", func() (int, string) { return 418, "i'm a teapot" // HTTP 418 : "i'm a teapot" }) Service Injection Handlers are invoked via reflection. Martini makes use of Dependency Injection to resolve dependencies in a Handlers argument list. This makes Martini completely compatible with golang's http.HandlerFunc interface. If you add an argument to your Handler, Martini will search its list of services and attempt to resolve the dependency via type assertion: m.Get("/", func(res http.ResponseWriter, req *http.Request) { // res and req are injected by Martini res.WriteHeader(200) // HTTP 200 }) The following services are included with martini.Classic(): *log.Logger - Global logger for Martini. martini.Context - http request context. martini.Params - map[string]string of named params found by route matching. martini.Routes - Route helper service. martini.Route - Current active route. http.ResponseWriter - http Response writer interface. *http.Request - http Request. Routing In Martini, a route is an HTTP method paired with a URL-matching pattern. Each route can take one or more handler methods: m.Get("/", func() { // show something }) m.Patch("/", func() { // update something }) m.Post("/", func() { // create something }) m.Put("/", func() { // replace something }) m.Delete("/", func() { // destroy something }) m.Options("/", func() { // http options }) m.NotFound(func() { // handle 404 }) Routes are matched in the order they are defined. The first route that matches the request is invoked. Route patterns may include named parameters, accessible via the martini.Params service: m.Get("/hello/:name", func(params martini.Params) string { return "Hello " + params["name"] }) Routes can be matched with globs: m.Get("/hello/**", func(params martini.Params) string { return "Hello " + params["_1"] }) Regular expressions can be used as well: m.Get("/hello/(?P<name>[a-zA-Z]+)", func(params martini.Params) string { return fmt.Sprintf ("Hello %s", params["name"]) }) Take a look at the Go documentation for more info about regular expressions syntax . Route handlers can be stacked on top of each other, which is useful for things like authentication and authorization: m.Get("/secret", authorize, func() { // this will execute as long as authorize doesn't write a response }) Route groups can be added too using the Group method. m.Group("/books", func(r martini.Router) { r.Get("/:id", GetBooks) r.Post("/new", NewBook) r.Put("/update/:id", UpdateBook) r.Delete("/delete/:id", DeleteBook) }) Just like you can pass middlewares to a handler you can pass middlewares to groups. m.Group("/books", func(r martini.Router) { r.Get("/:id", GetBooks) r.Post("/new", NewBook) r.Put("/update/:id", UpdateBook) r.Delete("/delete/:id", DeleteBook) }, MyMiddleware1, MyMiddleware2) Services Services are objects that are available to be injected into a Handler's argument list. You can map a service on a Global or Request level. Global Mapping A Martini instance implements the inject.Injector interface, so mapping a service is easy: db := &MyDatabase{} m := martini.Classic() m.Map(db) // the service will be available to all handlers as *MyDatabase // ... m.Run() Request-Level Mapping Mapping on the request level can be done in a handler via martini.Context: func MyCustomLoggerHandler(c martini.Context, req *http.Request) { logger := &MyCustomLogger{req} c.Map(logger) // mapped as *MyCustomLogger } Mapping values to Interfaces One of the most powerful parts about services is the ability to map a service to an in
Read the full README on GitHub

What Hacker News says

23 sources
This feels very similar to Martini (https://github.com/go-martini/martini). Martini had a similar sort of design (and IMO a cleaner source code), but the author decided that reflection and non-idoimatic design was too much of a cost for the HTTP framework in Go. I think 2 years ago when Martini was released people were more open to reflection, but now I'm interested/doubtful if something like this can be accepted. Funnily enough, I think Gin-Gonic was inspired by Martini, but Gin-Gonic eschewed reflection in favor of performance/idiomatic design. The fact that this project considers Gin Gonic an inspiration is funny.
In Gongular – A new web framework for Go
Coincidentally, the scoping issue is almost exactly the same issue that plagued Zope, a Python-based app server, back in the day. In Zope, any property could be inherited not just from the parent object, but from the current context; you could invoke the object path "a.b" and b would inherit from b, but if you invoked the object path "a.c.b", b would inherit from c instead. They called this design pattern "acquisition", and seemed rather proud of it until they realized it was the kind of magic that was ultimately too magical for its own good. The Zope guys tried very hard to eradicate it, and in the process ended up alienating all the developers with the new, non-backwards-compatible version. Funnily enough, there is another Angular parallel to Zope: Just like Zope 3, AngularJS 2.0 is also not backwards-compatible. Angular's parameter-bas
Read the rest
ed dependency injection is coincidentally the same reason Martini [1] is slower than most other Golang web frameworks. Clever, sure, but ultimately a design flaw. These problems demonstrate how important it is to introduce a good design from the very beginning. You can fix bad code, but bad design is much harder to change. [1] https://github.com/go-martini/martini#service-injection
In AngularJS: The Bad Parts
It is good to have many web microframeworks in a language ecosystem. In Python probably there are a hundred of those. Many of those are not picked up by the community –a natural selection. Only really a few of those survived. It all depends on you if you are going to choose Revel, Martini, Goji or whatever you want. Today, thousands of apps run on web.py, yet most of the source code is untouched last 3-5 years (https://github.com/webpy/webpy/tree/master/web) It's impressive it just works! Personally, I am looking for frameworks that many people rely on, maintained frequently as needed and works just fine. There could be a +-10% difference on QPS those framework URL routers can handle and render a 'hello world' page. So this is a nice attempt I would say, looks cleaner than Martini, still supports middlewares. On the other hand, Martini ha
Read the rest
s support to serve static files, logging, panic recovery, which are also good and has a bigger fanboy community around it: https://github.com/go-martini/martini
In Goji: a web microframework for Go
This is very true. It is a real issue in the open source world. http://github.com/codegangsta/martini tries to pride itself on minimalism. Thankfully the modularity of the project allows me to tell people to add features via other packages and repositories. Even though the product is solid it is difficult to communicate that the project is still active without having so many commits. This is one of the reasons that I find the Golang package management philosophy refreshing in theory. "Master should never break" really prevents feature creep from coming in and promotes the use of solid packages that aren't always being actively worked on. Of course there are some major drawbacks wrt lack of versioning in Go, but I think the philosophy there overall is a very good thing for open source development.
In What is a Web Framework?

Showing the 15 most recent of 23 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.