diff --git a/cli/command/service/update.go b/cli/command/service/update.go index d8f89185ae..811dcf22b3 100644 --- a/cli/command/service/update.go +++ b/cli/command/service/update.go @@ -1058,7 +1058,6 @@ func updatePorts(flags *pflag.FlagSet, portConfig *[]swarm.PortConfig) error { // Build the current list of portConfig for _, entry := range *portConfig { - entry := entry if _, ok := portSet[portConfigToString(&entry)]; !ok { portSet[portConfigToString(&entry)] = entry } @@ -1086,7 +1085,6 @@ portLoop: ports := flags.Lookup(flagPublishAdd).Value.(*opts.PortOpt).Value() for _, port := range ports { - port := port if _, ok := portSet[portConfigToString(&port)]; ok { continue }