mirror of https://github.com/docker/cli.git
cli/command/service: Using a reference for the variable on range scope `entry` (scopelint)
``` cli/command/service/update.go:1007:43: Using a reference for the variable on range scope `entry` (scopelint) if _, ok := portSet[portConfigToString(&entry)]; !ok { ^ cli/command/service/update.go:1008:32: Using a reference for the variable on range scope `entry` (scopelint) portSet[portConfigToString(&entry)] = entry ^ cli/command/service/update.go:1034:44: Using a reference for the variable on range scope `port` (scopelint) if _, ok := portSet[portConfigToString(&port)]; ok { ^ ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
3fa5aef0f9
commit
648199b321
|
@ -1004,6 +1004,7 @@ 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
|
||||
}
|
||||
|
@ -1031,6 +1032,7 @@ 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