mirror of https://github.com/docker/cli.git
cli/command/service: remove redundant capturing of loop vars (copyloopvar)
go1.22 and up now produce a unique variable in loops, tehrefore no longer requiring to capture the variable manually; cli/command/service/update.go:1061:3: The copy of the 'for' variable "entry" can be deleted (Go 1.22+) (copyloopvar) entry := entry ^ cli/command/service/update.go:1089:4: The copy of the 'for' variable "port" can be deleted (Go 1.22+) (copyloopvar) port := port ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
40833fd296
commit
32b40deb46
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue