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:
parent
83e6197380
commit
a7043ac5c4
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue