(ctx context.Context, dockerCLI command.Cli, opts *waitOptions)
| 40 | } |
| 41 | |
| 42 | func runWait(ctx context.Context, dockerCLI command.Cli, opts *waitOptions) error { |
| 43 | apiClient := dockerCLI.Client() |
| 44 | |
| 45 | var errs []error |
| 46 | for _, ctr := range opts.containers { |
| 47 | res := apiClient.ContainerWait(ctx, ctr, client.ContainerWaitOptions{}) |
| 48 | |
| 49 | select { |
| 50 | case result := <-res.Result: |
| 51 | _, _ = fmt.Fprintln(dockerCLI.Out(), strconv.FormatInt(result.StatusCode, 10)) |
| 52 | case err := <-res.Error: |
| 53 | errs = append(errs, err) |
| 54 | } |
| 55 | } |
| 56 | return errors.Join(errs...) |
| 57 | } |
no test coverage detected
searching dependent graphs…