diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-13 21:03:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 21:03:21 +0100 |
commit | 796ae87b1a3444557644944ddeb7cb37e303ef83 (patch) | |
tree | 192bd260c0b35519fe45ecbc91d7212251d82495 /cmd/podman/stats.go | |
parent | c1d93666d4b175be29a0ba229ee0b94d50765888 (diff) | |
parent | 768c476ae3c1dbf37204f5769b43746358af899d (diff) | |
download | podman-796ae87b1a3444557644944ddeb7cb37e303ef83.tar.gz podman-796ae87b1a3444557644944ddeb7cb37e303ef83.tar.bz2 podman-796ae87b1a3444557644944ddeb7cb37e303ef83.zip |
Merge pull request #4850 from vrothberg/fix-linting
Fix linting
Diffstat (limited to 'cmd/podman/stats.go')
-rw-r--r-- | cmd/podman/stats.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/podman/stats.go b/cmd/podman/stats.go index f53e09412..08fddc47a 100644 --- a/cmd/podman/stats.go +++ b/cmd/podman/stats.go @@ -105,9 +105,10 @@ func statsCmd(c *cliconfig.StatsValues) error { var ctrs []*libpod.Container containerFunc := runtime.GetRunningContainers - if len(c.InputArgs) > 0 { + switch { + case len(c.InputArgs) > 0: containerFunc = func() ([]*libpod.Container, error) { return runtime.GetContainersByList(c.InputArgs) } - } else if latest { + case latest: containerFunc = func() ([]*libpod.Container, error) { lastCtr, err := runtime.GetLatestContainer() if err != nil { @@ -115,7 +116,7 @@ func statsCmd(c *cliconfig.StatsValues) error { } return []*libpod.Container{lastCtr}, nil } - } else if all { + case all: containerFunc = runtime.GetAllContainers } @@ -219,14 +220,14 @@ func genStatsFormat(format string) string { } // imagesToGeneric creates an empty array of interfaces for output -func statsToGeneric(templParams []statsOutputParams, JSONParams []statsOutputParams) (genericParams []interface{}) { +func statsToGeneric(templParams []statsOutputParams, jsonParams []statsOutputParams) (genericParams []interface{}) { if len(templParams) > 0 { for _, v := range templParams { genericParams = append(genericParams, interface{}(v)) } return } - for _, v := range JSONParams { + for _, v := range jsonParams { genericParams = append(genericParams, interface{}(v)) } return |