Return an empty network list if nothing matches filter

Initializing the network list struct in order to return an empty list
instead of a nil object.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-06-29 00:06:44 +02:00
parent 83e6197380
commit a7043ac5c4
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -51,7 +51,7 @@ func filterNetworks(nws []types.NetworkResource, filter filters.Args) ([]types.N
return nil, err
}
var displayNet []types.NetworkResource
displayNet := []types.NetworkResource{}
for _, nw := range nws {
if filter.Include("driver") {
if !filter.ExactMatch("driver", nw.Driver) {