1
0
mirror of https://github.com/docker/cli.git synced 2026-01-26 15:41:42 +03:00

cli/command/container: createContainer: remove redundant closure

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-01-24 14:17:05 +01:00
parent adfb40ceb1
commit cfb71de7db

View File

@@ -318,15 +318,8 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
platform = &p
}
pullAndTagImage := func() error {
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
return err
}
return nil
}
if options.pull == PullImageAlways {
if err := pullAndTagImage(); err != nil {
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
return "", err
}
}
@@ -349,7 +342,7 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
_, _ = fmt.Fprintf(dockerCLI.Err(), "Unable to find image '%s' locally\n", reference.FamiliarString(namedRef))
}
if err := pullAndTagImage(); err != nil {
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
return "", err
}