diff --git a/cli/command/config/formatter.go b/cli/command/config/formatter.go index 4aebdb61ac..ee8bc23467 100644 --- a/cli/command/config/formatter.go +++ b/cli/command/config/formatter.go @@ -103,7 +103,7 @@ func (c *configContext) Labels() string { } var joinLabels []string for k, v := range mapLabels { - joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v)) + joinLabels = append(joinLabels, k+"="+v) } return strings.Join(joinLabels, ",") } diff --git a/cli/command/container/create.go b/cli/command/container/create.go index 4758714d1a..0c1574ff86 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -91,7 +91,7 @@ func runCreate(dockerCli command.Cli, flags *pflag.FlagSet, options *createOptio if v == nil { newEnv = append(newEnv, k) } else { - newEnv = append(newEnv, fmt.Sprintf("%s=%s", k, *v)) + newEnv = append(newEnv, k+"="+*v) } } copts.env = *opts.NewListOptsRef(&newEnv, nil) diff --git a/cli/command/container/run.go b/cli/command/container/run.go index c7e680e763..45eca8ffd6 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -101,7 +101,7 @@ func runRun(dockerCli command.Cli, flags *pflag.FlagSet, ropts *runOptions, copt if v == nil { newEnv = append(newEnv, k) } else { - newEnv = append(newEnv, fmt.Sprintf("%s=%s", k, *v)) + newEnv = append(newEnv, k+"="+*v) } } copts.env = *opts.NewListOptsRef(&newEnv, nil) diff --git a/cli/command/formatter/container.go b/cli/command/formatter/container.go index 60ad2fa40b..22b144f98f 100644 --- a/cli/command/formatter/container.go +++ b/cli/command/formatter/container.go @@ -247,7 +247,7 @@ func (c *ContainerContext) Labels() string { var joinLabels []string for k, v := range c.c.Labels { - joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v)) + joinLabels = append(joinLabels, k+"="+v) } return strings.Join(joinLabels, ",") } diff --git a/cli/command/network/formatter.go b/cli/command/network/formatter.go index ed8ac257a0..3229dfdd0a 100644 --- a/cli/command/network/formatter.go +++ b/cli/command/network/formatter.go @@ -103,7 +103,7 @@ func (c *networkContext) Labels() string { var joinLabels []string for k, v := range c.n.Labels { - joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v)) + joinLabels = append(joinLabels, k+"="+v) } return strings.Join(joinLabels, ",") } diff --git a/cli/command/secret/formatter.go b/cli/command/secret/formatter.go index 9102f28856..33c1451249 100644 --- a/cli/command/secret/formatter.go +++ b/cli/command/secret/formatter.go @@ -110,7 +110,7 @@ func (c *secretContext) Labels() string { } var joinLabels []string for k, v := range mapLabels { - joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v)) + joinLabels = append(joinLabels, k+"="+v) } return strings.Join(joinLabels, ",") } diff --git a/cli/command/system/events.go b/cli/command/system/events.go index ddac0fa0a0..08b0e47992 100644 --- a/cli/command/system/events.go +++ b/cli/command/system/events.go @@ -133,7 +133,7 @@ func prettyPrintEvent(out io.Writer, event eventtypes.Message) error { sort.Strings(keys) for _, k := range keys { v := event.Actor.Attributes[k] - attrs = append(attrs, fmt.Sprintf("%s=%s", k, v)) + attrs = append(attrs, k+"="+v) } fmt.Fprintf(out, " (%s)", strings.Join(attrs, ", ")) } diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index 7e0b8cfc99..6935c61968 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -1,7 +1,6 @@ package convert import ( - "fmt" "os" "sort" "strings" @@ -605,7 +604,7 @@ func convertEnvironment(source map[string]*string) []string { case nil: output = append(output, name) default: - output = append(output, fmt.Sprintf("%s=%s", name, *value)) + output = append(output, name+"="+*value) } }