From 0b7c72c3ba83407c8373b562f830c4d7f5b33dc9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 19 Jul 2023 14:26:02 +0200 Subject: [PATCH] cli/command/container: RunStart: inline variable Signed-off-by: Sebastiaan van Stijn --- cli/command/container/start.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/command/container/start.go b/cli/command/container/start.go index 0430bb090a..0a0b992ca8 100644 --- a/cli/command/container/start.go +++ b/cli/command/container/start.go @@ -146,13 +146,13 @@ func RunStart(dockerCli command.Cli, opts *StartOptions) error { // 3. We should open a channel for receiving status code of the container // no matter it's detached, removed on daemon side(--rm) or exit normally. statusChan := waitExitOrRemoved(ctx, dockerCli, c.ID, c.HostConfig.AutoRemove) - startOptions := types.ContainerStartOptions{ - CheckpointID: opts.Checkpoint, - CheckpointDir: opts.CheckpointDir, - } // 4. Start the container. - if err := dockerCli.Client().ContainerStart(ctx, c.ID, startOptions); err != nil { + err = dockerCli.Client().ContainerStart(ctx, c.ID, types.ContainerStartOptions{ + CheckpointID: opts.Checkpoint, + CheckpointDir: opts.CheckpointDir, + }) + if err != nil { cancelFun() <-cErr if c.HostConfig.AutoRemove {