【发布时间】:2017-07-14 22:41:36
【问题描述】:
这个 goroutine 阻塞...
go log.Fatal(http.ListenAndServe(":8000", nil))
log.Print("This doesn't print")
这个 goroutine 不会阻塞...
go func() {
log.Fatal(http.ListenAndServe(":8000", nil))
}()
log.Print("This prints")
这个 goroutine 也不会阻塞...
go http.ListenAndServe(":8000", nil)
log.Print("This prints")
【问题讨论】: