flynn/flynn-controller — pull request #5 by lmars (2014-04-24 17:08:25+00:00)
Title: Fix rendering empty crud lists

My previous fix for this (#4) did not work as the empty lists were not equal to `nil`, it was just that the json encoder was encoding the (unallocated?) lists as `null`.

I tried `if len(list) == 0` but because `list` is of type `interface{}` I got:

```
# github.com/flynn/flynn-controller
./crud.go:76: invalid argument list (type interface {}) for len
```

So instead I am explicitly allocating the lists (I think).

I did attempt to write a test for this but I was tying myself in knots, so I have verified it with curl:

```
vagrant@flynn:/vagrant/controller$ curl -k -u ":${KEY}" https://localhost/keys
[]
```