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.
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)