We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d82ff4 commit 7b1f889Copy full SHA for 7b1f889
1 file changed
cli/command/cli_options.go
@@ -118,9 +118,11 @@ func WithAPIClient(c client.APIClient) CLIOption {
118
// an API Client for use by the CLI.
119
func WithInitializeClient(makeClient func(*DockerCli) (client.APIClient, error)) CLIOption {
120
return func(cli *DockerCli) error {
121
- var err error
122
- cli.client, err = makeClient(cli)
123
- return err
+ c, err := makeClient(cli)
+ if err != nil {
+ return err
124
+ }
125
+ return WithAPIClient(c)(cli)
126
}
127
128
0 commit comments