(f http.HandlerFunc)
| 402 | type appHandler func(http.ResponseWriter, *http.Request) *appError |
| 403 | |
| 404 | func wrapHandlerFunc(f http.HandlerFunc) appHandler { |
| 405 | return func(w http.ResponseWriter, r *http.Request) *appError { |
| 406 | f.ServeHTTP(w, r) |
| 407 | return nil |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 412 | if e := fn(w, r); e != nil { // e is *appError |