-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
package main
import (
"log"
"net/http"
)
//delete this function, it would perform well
func useless_func(address string) []byte {
http.Get("https://www.google.com")
return nil
}
func test_a(test_channel chan int) {
test_channel <- 1
return
}
func test() {
test_channel := make(chan int)
for i := 0; i < 10; i++ {
go test_a(test_channel)
}
for {
log.Println(<-test_channel)
}
}
func main() {
test()
}
this code won't break because of clearly deadlock, it only happened under Linux with go 1.5.1. but if i delete useless_func and run it again, it would raise a deadlock error as expected.