Update 13.2md

Should use http.HandleFunc if the second argument is a function.
This commit is contained in:
Wei-Ting Kuo
2015-02-07 16:36:07 +08:00
parent fa5957ddf5
commit 3520c63d94

View File

@@ -14,7 +14,7 @@ HTTP路由组件负责将HTTP请求交到对应的函数处理(或者是一个st
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
}
http.Handle("/foo", fooHandler)
http.HandleFunc("/foo", fooHandler)
http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))