codegangsta/martini — pull request #128 by nemothekid (2013-12-17 07:52:28+00:00)
Title: Added support for []byte in the default return handler.

I decided to submit pull request for this because I ended up coming across a bug (or might just violate POLA). (#127)

First off the pull request allows you to return a byte slice in the default return handler, which is useful if you returning marshaled json or anything else you might want to write that isn't a byte.

```go
m.Get("/", func() []byte {
return []byte("hello world") // HTTP 200 : "hello world"
})
```

Secondly, while doing this I came across the fact that if your return type is an `interface{}`, something unexpected (or I thought was unexpected) happens:

```go
m.Get("/", func() interface{} {
return "hello world" // HTTP 200 : ""
})
```

Martini will currently write

```

```

to the stream. This is fixed by getting the value the element points to using `Value.Elem()`