codegangsta/martini — pull request #120 by codegangsta (2013-12-14 04:07:02+00:00)
Title: Added ResponseEncoder to allow hooks to process return values

This adds a service to Martini that will be used to encode the Return values coming from handlers. This does not change any behavior in Martini. It simply allows for custom return value handling if you want to do so. You can do it by mapping a `ReponseEncoder` service in one of your handlers.

~~~ go
re := func(rw http.ReponseWriter, vals []reflect.Value) {
// handle the vals here
}

// map it as a service to override functionality
m.Map(martini.ReponseEncoder(re))
~~~