这是个HTTP的回调,我看了HTTP模块的实现源码,w跟req都是类指针,为什么一个是,一个不是?
// hello world, the web server
func HelloServer(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "hello, world!\n")
}
为什么不是这样
// hello world, the web server
func HelloServer(w *http.ResponseWriter, req *http.Request) {
io.WriteString(w, "hello, world!\n")
}