// 创建多处理器的函数
func handle(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "net/http web", r.URL.Path)
}
func main() {
//映射的路径
http.HandleFunc("/",handle)
// 路由
http.ListenAndServe(":8000",nil)
}
Golang-----创建处理器
猜你喜欢
转载自blog.csdn.net/qq_35361859/article/details/103760566
今日推荐
周排行