mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon: S1033: unnecessary guard around call to delete (gosimple)
``` daemon/container_operations.go:787:2: S1033: unnecessary guard around call to delete (gosimple) if _, ok := container.NetworkSettings.Networks[n.ID()]; ok { ^ ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
cba180cac9
commit
6d9c219c54
2 changed files with 3 additions and 6 deletions
|
@ -493,9 +493,7 @@ func findConfigurationConflicts(config map[string]interface{}, flags *pflag.Flag
|
|||
if len(unknownKeys) > 0 {
|
||||
unknownNamedConflicts := func(f *pflag.Flag) {
|
||||
if namedOption, ok := f.Value.(opts.NamedOption); ok {
|
||||
if _, valid := unknownKeys[namedOption.Name()]; valid {
|
||||
delete(unknownKeys, namedOption.Name())
|
||||
}
|
||||
delete(unknownKeys, namedOption.Name())
|
||||
}
|
||||
}
|
||||
flags.VisitAll(unknownNamedConflicts)
|
||||
|
|
|
@ -784,9 +784,8 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
|
|||
EndpointSettings: endpointConfig,
|
||||
IPAMOperational: operIPAM,
|
||||
}
|
||||
if _, ok := container.NetworkSettings.Networks[n.ID()]; ok {
|
||||
delete(container.NetworkSettings.Networks, n.ID())
|
||||
}
|
||||
|
||||
delete(container.NetworkSettings.Networks, n.ID())
|
||||
|
||||
if err := daemon.updateEndpointNetworkSettings(container, n, ep); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue