mirror of https://github.com/jlelse/GoBlog
20 lines
328 B
Go
20 lines
328 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
type errorData struct {
|
|
Title string
|
|
Message string
|
|
}
|
|
|
|
func serve404(w http.ResponseWriter, r *http.Request) {
|
|
render(w, templateError, &errorData{
|
|
Title: "404 Not Found",
|
|
Message: fmt.Sprintf("`%s` was not found", r.RequestURI),
|
|
})
|
|
w.WriteHeader(http.StatusNotFound)
|
|
}
|