mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
15 lines
320 B
Go
15 lines
320 B
Go
package handlers
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func errorHandler(w http.ResponseWriter, r *http.Request, status int) {
|
|
w.WriteHeader(status)
|
|
if status == http.StatusNotFound {
|
|
t := template.Must(template.New("404.html").ParseFiles("templates/404.html", "templates/footer.html"))
|
|
t.Execute(w, nil)
|
|
}
|
|
}
|