Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created October 3, 2018 20:26
Show Gist options
  • Save Alir3z4/3557d3a78932992d705f0580647c74a4 to your computer and use it in GitHub Desktop.
Save Alir3z4/3557d3a78932992d705f0580647c74a4 to your computer and use it in GitHub Desktop.
func Notify(logger *log.Logger) Adapter {
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
logger.Println("before")
defer logger.Println("after")
h.ServeHTTP(w, r)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment