Hacker News new | ask | show | jobs
by alingse 1412 days ago
we have already do this in prod.

type HandlerFuncErr func(w http.ResponseWriter, r http.Request) error

func HandleErr(h HandlerFuncErr) http.HandlerFunc { return func(w http.ResponseWriter, r http.Request) { ... } }