Merge pull request #1217 from unihorn/146

main: not use loop variable in goroutine in loop body
release-2.0
Yicheng Qin 2014-10-01 11:25:53 -07:00
commit fd758c71b8
1 changed files with 6 additions and 3 deletions

View File

@ -220,8 +220,9 @@ func startEtcd() {
}
// Start the peer server in a goroutine
urlStr := u.String()
go func() {
log.Print("Listening for peers on ", u.String())
log.Print("Listening for peers on ", urlStr)
log.Fatal(http.Serve(l, ph))
}()
}
@ -233,8 +234,9 @@ func startEtcd() {
log.Fatal(err)
}
urlStr := u.String()
go func() {
log.Print("Listening for client requests on ", u.String())
log.Print("Listening for client requests on ", urlStr)
log.Fatal(http.Serve(l, ch))
}()
}
@ -268,8 +270,9 @@ func startProxy() {
log.Fatal(err)
}
host := u.Host
go func() {
log.Print("Listening for client requests on ", u.Host)
log.Print("Listening for client requests on ", host)
log.Fatal(http.Serve(l, ph))
}()
}