Skip to content

Commit cfb71de

Browse files
committed
cli/command/container: createContainer: remove redundant closure
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent adfb40c commit cfb71de

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

cli/command/container/create.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,8 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
318318
platform = &p
319319
}
320320

321-
pullAndTagImage := func() error {
322-
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
323-
return err
324-
}
325-
return nil
326-
}
327-
328321
if options.pull == PullImageAlways {
329-
if err := pullAndTagImage(); err != nil {
322+
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
330323
return "", err
331324
}
332325
}
@@ -349,7 +342,7 @@ func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *c
349342
_, _ = fmt.Fprintf(dockerCLI.Err(), "Unable to find image '%s' locally\n", reference.FamiliarString(namedRef))
350343
}
351344

352-
if err := pullAndTagImage(); err != nil {
345+
if err := pullImage(ctx, dockerCLI, config.Image, options); err != nil {
353346
return "", err
354347
}
355348

0 commit comments

Comments
 (0)