jinzhu/gorm — pull request #292 by jnfeinstein (2014-11-22 10:32:11+00:00)
Title: Create empty slice when records are not found.

There is a gotcha in golang (go figure!) resulting from the
difference between a nil slice and an empty slice. While the length
of both are ```0```, the JSON encoder will interpret the nil slice as
```null``` and the empty slice as ```[]```. Other libraries (i.e. ActiveRecord)
will return ```[]``` when no values are found. I have found
that this translates into better client-side code, since you don't
have to protect against ```null``` arrays.

See [this](http://danott.co/posts/json-marshalling-empty-slices-to-empty-arrays-in-go.html) for more information.