Skip to content

Instantly share code, notes, and snippets.

@anhnguyen1618
Created August 19, 2017 14:46
Show Gist options
  • Save anhnguyen1618/b4c5ae99453926e3bafdbbeadb190fab to your computer and use it in GitHub Desktop.
Save anhnguyen1618/b4c5ae99453926e3bafdbbeadb190fab to your computer and use it in GitHub Desktop.
type Handler interface {
ServeHTTP(ResponseWriter, *Request) // routing implementer
}
type HandlerFunc func(ResponseWriter, *Request)
// ServeHTTP calls f(w, r).
func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
f(w, r)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment