123456789101112131415161718192021222324252627282930 |
- package routers
- import (
- "html/template"
- "net/http"
- )
- var err404tpl = `
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>{{.Title}}</title>
- </head>
- <body>
- <div id="wrapper">
- {{.Title}}
- </div>
- </body>
- </html>
- `
- // show 404 notfound error.
- func notFound(rw http.ResponseWriter, r *http.Request) {
- t, _ := template.New("error").Parse(err404tpl)
- data := map[string]interface{}{
- "Title": http.StatusText(404),
- }
- t.Execute(rw, data)
- }
|