summaryrefslogtreecommitdiff
path: root/cmd/podman/main.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/main.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/main.go')
-rw-r--r--cmd/podman/main.go25
1 files changed, 9 insertions, 16 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index c727eea85..a22b01f24 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -72,17 +72,13 @@ var mainCommands = []*cobra.Command{
}
var rootCmd = &cobra.Command{
- Use: path.Base(os.Args[0]),
- Long: "manage pods and images",
- RunE: commandRunE(),
- PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
- return before(cmd, args)
- },
- PersistentPostRunE: func(cmd *cobra.Command, args []string) error {
- return after(cmd, args)
- },
- SilenceUsage: true,
- SilenceErrors: true,
+ Use: path.Base(os.Args[0]),
+ Long: "manage pods and images",
+ RunE: commandRunE(),
+ PersistentPreRunE: before,
+ PersistentPostRunE: after,
+ SilenceUsage: true,
+ SilenceErrors: true,
}
var MainGlobalOpts cliconfig.MainFlags
@@ -160,16 +156,13 @@ func main() {
}
if err := rootCmd.Execute(); err != nil {
outputError(err)
- } else {
+ } else if exitCode == define.ExecErrorCodeGeneric {
// The exitCode modified from define.ExecErrorCodeGeneric,
// indicates an application
// running inside of a container failed, as opposed to the
// podman command failed. Must exit with that exit code
// otherwise command exited correctly.
- if exitCode == define.ExecErrorCodeGeneric {
- exitCode = 0
- }
-
+ exitCode = 0
}
// Check if /etc/containers/registries.conf exists when running in