News for hackers. Stuff that matters.
Re:A Comparison of Go Web Frameworks (2014) by dang on Tuesday June 16, 2015 @02:12AM (#9724070)
Re:A Comparison of Go Web Frameworks (2014) by tptacek on Monday June 15, 2015 @11:43PM (#9723691)
This is pretty old, especially in "Go Web Framework" terms.
Re:A Comparison of Go Web Frameworks (2014) by hippo8 on Tuesday June 16, 2015 @01:20AM (#9723953)
So what is new? Not trying to be funny or anything, I am genuinely interested.
Re:A Comparison of Go Web Frameworks (2014) by socceroos on Tuesday June 16, 2015 @02:48AM (#9724152)
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.

Re:A Comparison of Go Web Frameworks (2014) by zkirill on Monday June 15, 2015 @11:29PM (#9723648)
You may also want to take a look at 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.
Re:A Comparison of Go Web Frameworks (2014) by mattmc on Tuesday June 16, 2015 @12:02AM (#9723749)
Also Maracon (https://github.com/Unknwon/macaron), Negroni (https://github.com/codegangsta/negroni), and 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.
Re:A Comparison of Go Web Frameworks (2014) by cat9 on Tuesday June 16, 2015 @12:29AM (#9723827)
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/

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

https://github.com/gorilla

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

https://github.com/garyburd/redigo

https://github.com/go-gorp/gorp

Re:A Comparison of Go Web Frameworks (2014) by mattmc on Tuesday June 16, 2015 @02:06AM (#9724056)
Gorp is nice, although I prefer the sqlx-based flavor, Modl (https://github.com/jmoiron/modl).
Re:A Comparison of Go Web Frameworks (2014) by cat9 on Tuesday June 16, 2015 @03:26AM (#9724247)
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.
Re:A Comparison of Go Web Frameworks (2014) by Everlag on Tuesday June 16, 2015 @01:33AM (#9723981)
I have been using go-restful which lets you wrap documentation into the code. It generates swagger docs which are very nice to deal with.

https://github.com/emicklei/go-restful

Re:A Comparison of Go Web Frameworks (2014) by kylequest on Monday June 15, 2015 @11:41PM (#9723688)
Gorilla does include a "context" library: http://www.gorillatoolkit.org/pkg/context
Re:A Comparison of Go Web Frameworks (2014) by de_dave on Tuesday June 16, 2015 @03:27AM (#9724248)
Moving forward, of course, it's preferable to use the official context package: http://godoc.org/golang.org/x/net/context
Re:A Comparison of Go Web Frameworks (2014) by kylequest on Tuesday June 16, 2015 @11:41AM (#9726571)
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).
Re:A Comparison of Go Web Frameworks (2014) by beefsack on Monday June 15, 2015 @11:38PM (#9723673)
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.
Re:A Comparison of Go Web Frameworks (2014) by tptacek on Monday June 15, 2015 @11:43PM (#9723690)
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.

Re:A Comparison of Go Web Frameworks (2014) by bojo on Tuesday June 16, 2015 @01:31AM (#9723976)
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.

Re:A Comparison of Go Web Frameworks (2014) by juliangregorian on Tuesday June 16, 2015 @10:13AM (#9725907)
Re:A Comparison of Go Web Frameworks (2014) by bojo on Tuesday June 16, 2015 @11:41PM (#9729963)
Re:A Comparison of Go Web Frameworks (2014) by tptacek on Wednesday June 17, 2015 @03:31AM (#9730457)
Going from 30 servers to 2 sounds like something whose cost savings might add up to as much as 100 hours of developer time.
Re:A Comparison of Go Web Frameworks (2014) by juliangregorian on Wednesday June 17, 2015 @02:21PM (#9734123)
That's cool. I bet they could reduce it to 0.15 servers by rewriting it in C.

They probably would have drastically reduced the number of servers even if the rewrite was still in ruby, having much better understanding around the runtime requirements.

Ruby also seems like a questionable choice in the first place for such a service. Perhaps a prototype.

Nobody is pretending that MRI Ruby is the most performant runtime you can find, but that's just not an issue for 99% of web stacks.

Re:A Comparison of Go Web Frameworks (2014) by interactiv on Tuesday June 16, 2015 @12:53AM (#9723900)
> The Go standard library is so strong around web servers it's hard to recommend anything else.

The http packages provides the bare minimum. A serious app requires way more features than what is provided,a router than handles route variables, a middleware stack, a proper context, a proper session mechanism if one writes a website...

So it's normal people write their own libraries on top of it ( like mine @ gopkg.in/interactiv/expresso.v0 ,still alpha )

Re:A Comparison of Go Web Frameworks (2014) by wyc on Monday June 15, 2015 @11:57PM (#9723732)
My personal favorite is 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.

Re:A Comparison of Go Web Frameworks (2014) by juliangregorian on Monday June 15, 2015 @11:55PM (#9723721)
Obligatory s/martini/negroni comment here.
Re:A Comparison of Go Web Frameworks (2014) by socceroos on Tuesday June 16, 2015 @02:51AM (#9724161)
Exactly, the author himself stated as much.