go http请求会阻塞

whsyy · · 2417 次点击
你没提供代码,怎么帮你查问题
#1
更多评论
```go package main import ( "fmt" "net/http" ) func main() { var handleMap = map[string]func(http.ResponseWriter, *http.Request){} handleMap["/"] = index handleMap["/welcome"] = welcome for k, v := range handleMap { http.HandleFunc(k, v) } fmt.Println("http server Running on:", 9001) err := http.ListenAndServe(":9001", nil) if err != nil { panic(err) } } func index(w http.ResponseWriter, r *http.Request) { fmt.Println("index") } func welcome(w http.ResponseWriter, r *http.Request) { fmt.Println("welcome") } ``` 这个是源代码
#2
看看这个 http://www.cnblogs.com/jasondan/p/3776132.html
#3