News for hackers. Stuff that matters.
Re:Martini: Classy web development in Go by semisight on Thursday November 14, 2013 @03:10AM (#6731224)
Very cool. Reminiscent of express.js, but statically typed and in Go. I may look at this for future projects.
Re:Martini: Classy web development in Go by mmgutz on Thursday November 14, 2013 @03:26AM (#6731269)
Looks like a lot of reflection. At that point, I would just stick with express and node. All that magic comes at a cost.
Re:Martini: Classy web development in Go by elithrar on Thursday November 14, 2013 @04:04AM (#6731367)
> Looks like a lot of reflection. At that point, I would just stick with express and node. All that magic comes at a cost.

There's one use of reflection[1], and it's to ensure that the argument is a function.

Reflection isn't inherently bad; using it at the drop of a hat is.

[1]: https://github.com/codegangsta/martini/blob/master/martini.g...

[edit]: Looks like I missed the `inject` import (thanks breakpete)

Re:Martini: Classy web development in Go by breakpete on Thursday November 14, 2013 @04:23AM (#6731440)
There is more. The dependency injection implementation is based on reflection, using the https://github.com/codegangsta/inject package.

See e.g

https://github.com/codegangsta/martini/blob/master/martini.g...

https://github.com/codegangsta/martini/blob/master/martini.g...

Still, the end result is a nice API.