summaryrefslogtreecommitdiff
path: root/pkg/adapter/shortcuts
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 /pkg/adapter/shortcuts
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 'pkg/adapter/shortcuts')
-rw-r--r--pkg/adapter/shortcuts/shortcuts.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/adapter/shortcuts/shortcuts.go b/pkg/adapter/shortcuts/shortcuts.go
index 4f6cfd6a3..8a8459c6c 100644
--- a/pkg/adapter/shortcuts/shortcuts.go
+++ b/pkg/adapter/shortcuts/shortcuts.go
@@ -42,12 +42,13 @@ func GetContainersByContext(all, latest bool, names []string, runtime *libpod.Ru
var ctr *libpod.Container
ctrs = []*libpod.Container{}
- if all {
+ switch {
+ case all:
ctrs, err = runtime.GetAllContainers()
- } else if latest {
+ case latest:
ctr, err = runtime.GetLatestContainer()
ctrs = append(ctrs, ctr)
- } else {
+ default:
for _, n := range names {
ctr, e := runtime.LookupContainer(n)
if e != nil {