

A Comparison of Go Web Frameworks (2014) - jeffreyrogers
https://corner.squareup.com/2014/05/evaluating-go-frameworks.html

======
dang
[https://news.ycombinator.com/item?id=7785991](https://news.ycombinator.com/item?id=7785991)

------
tptacek
This is pretty old, especially in "Go Web Framework" terms.

~~~
hippo8
So what is new? Not trying to be funny or anything, I am genuinely interested.

~~~
socceroos
Its missing a lot of the newer more idiomatic frameworks/libraries that have
gained considerable traction.

There's heaps of them, but the major one that strikes me is Negroni.

------
zkirill
You may also want to take a look at beego
([https://github.com/astaxie/beego](https://github.com/astaxie/beego)). It
introduces a lot of workflow features on top of routing. Also, you may have an
easier time with it if you can read Chinese.

~~~
mattmc
Also Maracon
([https://github.com/Unknwon/macaron](https://github.com/Unknwon/macaron)),
Negroni
([https://github.com/codegangsta/negroni](https://github.com/codegangsta/negroni)),
and Goji ([https://github.com/zenazn/goji](https://github.com/zenazn/goji)).
Negroni is from the creator of Martini, Goji is apparently high in
antioxidants, but I'm partial to Macaron. I also use a homegrown Gorilla-based
library at work...there's more than one way to skin this cat, that's for sure.

------
cat9
I've been using go-json-rest, which is by way of "just enough on top of
net/http to make APIs easier."

[https://ant0ine.github.io/go-json-rest/](https://ant0ine.github.io/go-json-
rest/)

Gorilla is useful, but more for its range of standalone components than as a
framework.

[https://github.com/gorilla](https://github.com/gorilla)

Then you'll want database-related packages like redigo and gorp.

[https://github.com/garyburd/redigo](https://github.com/garyburd/redigo)

[https://github.com/go-gorp/gorp](https://github.com/go-gorp/gorp)

~~~
mattmc
Gorp is nice, although I prefer the sqlx-based flavor, Modl
([https://github.com/jmoiron/modl](https://github.com/jmoiron/modl)).

~~~
cat9
I'm still kind of on the fence about this. I like a lot of the choices Modl
makes as a fork of Gorp, but it has significantly fewer users, particularly in
the case of e.g. modl-migrate vs. sql-migrate.

------
kylequest
Gorilla does include a "context" library:
[http://www.gorillatoolkit.org/pkg/context](http://www.gorillatoolkit.org/pkg/context)

~~~
de_dave
Moving forward, of course, it's preferable to use the official context
package:
[http://godoc.org/golang.org/x/net/context](http://godoc.org/golang.org/x/net/context)

~~~
kylequest
It complements Gorilla context. It's not a replacement because it doesn't
solve the context problem for middleware (no way to pass net/context from
middleware to your handler code).

------
beefsack
Articles on Go web frameworks all end up at the same conclusion. The Go
standard library is so strong around web servers it's hard to recommend
anything else.

~~~
tptacek
It's not entirely that simple. The problem isn't that net/http is so amazing
that it's silly to replace it; it's that the replacements aren't yet up to the
challenge --- by which I mean, none of them are yet so much of a win that the
cost of losing compatibility with net/http outweighs the benefits.

Writing full-featured web apps in Golang in 2015 is still a lot like writing a
Sinatra app was 8 years ago. It feels great at first, but you quickly realize
that you're just building a half-assed version of Rails.

~~~
bojo
An alternative way to look at it would be "you are only building the 20% of
Rails you actually need."

I've never been a fan of full-fledged frameworks and prefer the more pragmatic
method of only pulling in components that I need though.

~~~
juliangregorian
[https://github.com/rails-api/rails-api#why-use-rails-for-
jso...](https://github.com/rails-api/rails-api#why-use-rails-for-json-apis)

~~~
bojo
[http://blog.iron.io/2013/03/how-we-went-from-30-servers-
to-2...](http://blog.iron.io/2013/03/how-we-went-from-30-servers-to-2-go.html)

~~~
tptacek
Going from 30 servers to 2 sounds like something whose cost savings might add
up to as much as 100 hours of developer time.

------
wyc
My personal favorite is alice:

[https://github.com/justinas/alice](https://github.com/justinas/alice)

It's not very much code (only ~90 lines inc. comments), but I think it
establishes a pattern that makes everything very straightforward from
authentication to logging to runtime analysis. Plays very nicely with gorilla.
I think the more you let net/http shine, the better.

------
juliangregorian
Obligatory s/martini/negroni comment here.

~~~
socceroos
Exactly, the author himself stated as much.

