Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. http.Handle("/foo", fooHandler)
  2. http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
  3. fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
  4. })
  5.  
  6. 1216 type HandlerFunc func(ResponseWriter, *Request)
  7. 1217
  8. 1218 // ServeHTTP calls f(w, r).
  9. 1219 func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
  10. 1220 f(w, r)
  11. 1221 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement