mirror of
https://github.com/jlelse/GoBlog
synced 2024-06-29 12:07:36 +00:00
20 lines
327 B
Go
20 lines
327 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)
|
||
|
}
|