From 208d553cecbf4e62dceaa0757c8e7f1a5aaca68d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 9 Sep 2021 18:41:26 +0200 Subject: [PATCH] cmd/run: Style fixes Fallout from 4536e2c8c28f6c4fed5e0346ea1094156e449f59 https://github.com/containers/toolbox/pull/872 --- src/cmd/run.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cmd/run.go b/src/cmd/run.go index e8e9693..6b6b0fd 100644 --- a/src/cmd/run.go +++ b/src/cmd/run.go @@ -322,11 +322,9 @@ func runCommandWithFallbacks(container string, command []string, emitEscapeSeque } return nil case 125: - err = fmt.Errorf("failed to invoke 'podman exec' in container %s", container) - return err + return fmt.Errorf("failed to invoke 'podman exec' in container %s", container) case 126: - err = fmt.Errorf("failed to invoke command %s in container %s", command[0], container) - return err + return fmt.Errorf("failed to invoke command %s in container %s", command[0], container) case 127: if pathPresent, _ := isPathPresent(container, workDir); !pathPresent { if runFallbackWorkDirsIndex < len(runFallbackWorkDirs) { @@ -343,8 +341,7 @@ func runCommandWithFallbacks(container string, command []string, emitEscapeSeque fmt.Fprintf(os.Stderr, "Using %s instead.\n", workDir) runFallbackWorkDirsIndex++ } else { - err = fmt.Errorf("directory %s not found in container %s", workDir, container) - return err + return fmt.Errorf("directory %s not found in container %s", workDir, container) } } else { if fallbackToBash && runFallbackCommandsIndex < len(runFallbackCommands) { @@ -358,8 +355,7 @@ func runCommandWithFallbacks(container string, command []string, emitEscapeSeque runFallbackCommandsIndex++ } else { - err = fmt.Errorf("command %s not found in container %s", command[0], container) - return err + return fmt.Errorf("command %s not found in container %s", command[0], container) } } default: