summaryrefslogtreecommitdiff
path: root/cmd/podman/common_libpod.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-13 13:01:45 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-13 14:27:02 +0100
commit67165b76753f65b6f58d471f314678ae12a4c722 (patch)
tree72580ee08e5d9d2e57b97a7293deaf8a2a0f2e67 /cmd/podman/common_libpod.go
parent270d892c3d77de4fd8e6341193175c0572fb5f99 (diff)
downloadpodman-67165b76753f65b6f58d471f314678ae12a4c722.tar.gz
podman-67165b76753f65b6f58d471f314678ae12a4c722.tar.bz2
podman-67165b76753f65b6f58d471f314678ae12a4c722.zip
make lint: enable gocritic
`gocritic` is a powerful linter that helps in preventing certain kinds of errors as well as enforcing a coding style. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/common_libpod.go')
-rw-r--r--cmd/podman/common_libpod.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/common_libpod.go b/cmd/podman/common_libpod.go
index 5deea15d3..b97ff5986 100644
--- a/cmd/podman/common_libpod.go
+++ b/cmd/podman/common_libpod.go
@@ -24,7 +24,8 @@ func getAllOrLatestContainers(c *cliconfig.PodmanCommand, runtime *libpod.Runtim
var containers []*libpod.Container
var lastError error
var err error
- if c.Bool("all") {
+ switch {
+ case c.Bool("all"):
if filterState != -1 {
var filterFuncs []libpod.ContainerFilter
filterFuncs = append(filterFuncs, func(c *libpod.Container) bool {
@@ -38,13 +39,13 @@ func getAllOrLatestContainers(c *cliconfig.PodmanCommand, runtime *libpod.Runtim
if err != nil {
return nil, errors.Wrapf(err, "unable to get %s containers", verb)
}
- } else if c.Bool("latest") {
+ case c.Bool("latest"):
lastCtr, err := runtime.GetLatestContainer()
if err != nil {
return nil, errors.Wrapf(err, "unable to get latest container")
}
containers = append(containers, lastCtr)
- } else {
+ default:
args := c.InputArgs
for _, i := range args {
container, err := runtime.LookupContainer(i)