package weberror import ( "html/template" "io" ) type ErrorPage struct { Error error StatusCode int } func NewPage(err error, statusCode int) *ErrorPage { return &ErrorPage{ Error: err, StatusCode: statusCode, } } func (page ErrorPage) Send(w io.Writer, t template.Template) { t.Lookup("error.html").Execute(w, page) }