http源码

1 分析以下代码

http源码
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)
    }
}
View Code

http源码

上一篇:js的赋值与比较运算符


下一篇:浏览器 HTTP 协议缓存机制详解