commands: pass arguments inline

newer Docker releases has Opt struct instead of this func
This commit is contained in:
Dawid Dziurla 2019-11-16 13:40:55 +01:00
parent 724d501115
commit 450d163040
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -68,12 +68,7 @@ func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {
// NewDockerCommand it runs docker commands
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
opts := []func(*client.Client) error{
client.WithVersion(APIVersion),
client.FromEnv,
}
cli, err := client.NewClientWithOpts(opts...)
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion(APIVersion))
if err != nil {
return nil, err
}