adb90d657c
* Bundle fields used in most template variables under CommonTemplateVariables * Make handlers use CommonTemplateVariables
16 lignes
346 o
Go
16 lignes
346 o
Go
package router
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusNotFound)
|
|
|
|
nftv := NotFoundTemplateVariables{NewCommonVariables(r)}
|
|
|
|
err := notFoundTemplate.ExecuteTemplate(w, "index.html", nftv)
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
}
|
|
}
|