MCPcopy Create free account
hub / github.com/mpolden/echoip / wrapHandlerFunc

Function wrapHandlerFunc

http/http.go:404–409  ·  view source on GitHub ↗
(f http.HandlerFunc)

Source from the content-addressed store, hash-verified

402type appHandler func(http.ResponseWriter, *http.Request) *appError
403
404func 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
411func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
412 if e := fn(w, r); e != nil { // e is *appError

Callers 1

HandlerMethod · 0.85

Calls 1

ServeHTTPMethod · 0.80

Tested by

no test coverage detected