diff options
author | baude <bbaude@redhat.com> | 2019-07-08 13:20:17 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-07-10 15:52:17 -0500 |
commit | e053e0e05ecd884067125627f0006d1b6e19226e (patch) | |
tree | 9e5bcca7703a041b23c2e3c9fcfe928e8bca2962 /cmd/podman/utils.go | |
parent | 81e722d08617ee19235bf57de6d86124e6b4574a (diff) | |
download | podman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.gz podman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.bz2 podman-e053e0e05ecd884067125627f0006d1b6e19226e.zip |
first pass of corrections for golangci-lint
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r-- | cmd/podman/utils.go | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index 986db469e..0790f673a 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -3,27 +3,12 @@ package main import ( "fmt" "reflect" + "runtime/debug" + "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) -// printParallelOutput takes the map of parallel worker results and outputs them -// to stdout -func printParallelOutput(m map[string]error, errCount int) error { - var lastError error - for cid, result := range m { - if result != nil { - if errCount > 1 { - fmt.Println(result.Error()) - } - lastError = result - continue - } - fmt.Println(cid) - } - return lastError -} - // print results from CLI command func printCmdResults(ok []string, failures map[string]error) error { for _, id := range ok { @@ -48,6 +33,17 @@ func printCmdResults(ok []string, failures map[string]error) error { // on the remote-client func markFlagHiddenForRemoteClient(flagName string, flags *pflag.FlagSet) { if remoteclient { - flags.MarkHidden(flagName) + if err := flags.MarkHidden(flagName); err != nil { + debug.PrintStack() + logrus.Errorf("unable to mark %s as hidden in the remote-client", flagName) + } + } +} + +// markFlagHidden is a helper function to log an error if marking +// a flag as hidden happens to fail +func markFlagHidden(flags *pflag.FlagSet, flag string) { + if err := flags.MarkHidden(flag); err != nil { + logrus.Errorf("unable to mark flag '%s' as hidden: %q", flag, err) } } |