Skip to content

Instantly share code, notes, and snippets.

View lunemec's full-sized avatar

Lukáš Němec lunemec

View GitHub Profile
@lunemec
lunemec / handler.go
Last active January 26, 2019 16:46
upgraded handler
// Handler is http handler func that returns error which will be written
// to ResponseWriter automatically.
type Handler func(http.ResponseWriter, *http.Request) error
// Response represents an error with an associated HTTP status code.
type Response struct {
Code int
RequestID RequestID
Err error
}