本章通过编写功能逐渐复杂的 web 服务器来让开发者对如何运用 go 语言有一个初步的了解。web 服务的地址 http://localhost:8000。 1. 启动一个最简单的 web 服务器 package main import ( "fmt" "log" "net/http" ) func main() { http.HandleFunc("/", handler) //用handler函数处理根路由下的每个请求 log.Fatal(http.ListenAndServe("localhost:8000",