Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http.Handle("/foo", fooHandler)
- http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
- fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
- })
- 1216 type HandlerFunc func(ResponseWriter, *Request)
- 1217
- 1218 // ServeHTTP calls f(w, r).
- 1219 func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
- 1220 f(w, r)
- 1221 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement