From 67165b76753f65b6f58d471f314678ae12a4c722 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 13 Jan 2020 13:01:45 +0100 Subject: 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 --- pkg/adapter/shortcuts/shortcuts.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/adapter/shortcuts') 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 { -- cgit v1.2.3-54-g00ecf