summaryrefslogtreecommitdiff
path: root/cmd/podman/shared/container.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-10-11 16:48:09 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-10-11 16:52:18 +0200
commitf7d55d64e7040cdad149684234ea150b0a90cf0e (patch)
tree11aa66b90a943ce7a6562d0e68252e57f40f2740 /cmd/podman/shared/container.go
parent10cbaadf4ab1d2a644db79ed82e639c6ad279ba1 (diff)
downloadpodman-f7d55d64e7040cdad149684234ea150b0a90cf0e.tar.gz
podman-f7d55d64e7040cdad149684234ea150b0a90cf0e.tar.bz2
podman-f7d55d64e7040cdad149684234ea150b0a90cf0e.zip
container: initialize results list
it solves: $ podman ps --format=json null Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/shared/container.go')
-rw-r--r--cmd/podman/shared/container.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/podman/shared/container.go b/cmd/podman/shared/container.go
index 022377b1f..15bbb46d2 100644
--- a/cmd/podman/shared/container.go
+++ b/cmd/podman/shared/container.go
@@ -449,10 +449,8 @@ func GetPsContainerOutput(r *libpod.Runtime, opts PsOptions, filters []string, m
// PBatch performs batch operations on a container in parallel. It spawns the
// number of workers relative to the number of parallel operations desired.
func PBatch(containers []*libpod.Container, workers int, opts PsOptions) []PsContainerOutput {
- var (
- wg sync.WaitGroup
- psResults []PsContainerOutput
- )
+ var wg sync.WaitGroup
+ psResults := []PsContainerOutput{}
// If the number of containers in question is less than the number of
// proposed parallel operations, we shouldnt spawn so many workers.