From 167fa429f0baa620721c0e8b7999cbc2cbe12dd2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 29 Apr 2023 02:59:54 +0200 Subject: [PATCH] daemon: Daemon.CreateImageFromContainer(): remove intermediate vars Signed-off-by: Sebastiaan van Stijn --- daemon/commit.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/daemon/commit.go b/daemon/commit.go index fbcf644484..a442cd021e 100644 --- a/daemon/commit.go +++ b/daemon/commit.go @@ -132,13 +132,11 @@ func (daemon *Daemon) CreateImageFromContainer(ctx context.Context, name string, } if container.IsDead() { - err := fmt.Errorf("You cannot commit container %s which is Dead", container.ID) - return "", errdefs.Conflict(err) + return "", errdefs.Conflict(fmt.Errorf("You cannot commit container %s which is Dead", container.ID)) } if container.IsRemovalInProgress() { - err := fmt.Errorf("You cannot commit container %s which is being removed", container.ID) - return "", errdefs.Conflict(err) + return "", errdefs.Conflict(fmt.Errorf("You cannot commit container %s which is being removed", container.ID)) } if c.Pause && !container.IsPaused() {