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 {
|
if len(unknownKeys) > 0 {
|
||||||
unknownNamedConflicts := func(f *pflag.Flag) {
|
unknownNamedConflicts := func(f *pflag.Flag) {
|
||||||
if namedOption, ok := f.Value.(opts.NamedOption); ok {
|
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)
|
flags.VisitAll(unknownNamedConflicts)
|
||||||
|
|
|
@ -784,9 +784,8 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
|
||||||
EndpointSettings: endpointConfig,
|
EndpointSettings: endpointConfig,
|
||||||
IPAMOperational: operIPAM,
|
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 {
|
if err := daemon.updateEndpointNetworkSettings(container, n, ep); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue