1 分析以下代码
package main import ( "fmt" "log" "net/http" ) func handleRequest(w http.ResponseWriter, r *http.Request) { fmt.Println("aaaaa") } func main() { // set route http.HandleFunc("/a/", handleRequest) fmt.Println("Listening at port 9090...") // listen at port 9090 and serve requests err := http.ListenAndServe(":9090", nil) if err != nil { log.Fatal("ListenAndServe: ", err) } }
2