mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix go vet issue in daemon/daemon.go
This fix fixes go vet issue: ``` daemon/daemon.go:273: loop variable id captured by func literal daemon/daemon.go:280: loop variable id captured by func literal ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
b958b430aa
commit
7315a2bb11
1 changed files with 3 additions and 3 deletions
|
@ -260,7 +260,7 @@ func (daemon *Daemon) restore() error {
|
||||||
restartContainers := make(map[*container.Container]chan struct{})
|
restartContainers := make(map[*container.Container]chan struct{})
|
||||||
activeSandboxes := make(map[string]interface{})
|
activeSandboxes := make(map[string]interface{})
|
||||||
|
|
||||||
for id, c := range containers {
|
for _, c := range containers {
|
||||||
group.Add(1)
|
group.Add(1)
|
||||||
go func(c *container.Container) {
|
go func(c *container.Container) {
|
||||||
defer group.Done()
|
defer group.Done()
|
||||||
|
@ -270,14 +270,14 @@ func (daemon *Daemon) restore() error {
|
||||||
if err := daemon.registerName(c); err != nil {
|
if err := daemon.registerName(c); err != nil {
|
||||||
logrus.Errorf("Failed to register container name %s: %s", c.ID, err)
|
logrus.Errorf("Failed to register container name %s: %s", c.ID, err)
|
||||||
mapLock.Lock()
|
mapLock.Lock()
|
||||||
delete(containers, id)
|
delete(containers, c.ID)
|
||||||
mapLock.Unlock()
|
mapLock.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := daemon.Register(c); err != nil {
|
if err := daemon.Register(c); err != nil {
|
||||||
logrus.Errorf("Failed to register container %s: %s", c.ID, err)
|
logrus.Errorf("Failed to register container %s: %s", c.ID, err)
|
||||||
mapLock.Lock()
|
mapLock.Lock()
|
||||||
delete(containers, id)
|
delete(containers, c.ID)
|
||||||
mapLock.Unlock()
|
mapLock.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue