chrly/lib/routes/NotFound.go
ErickSkrauch 3d65529d2e Добавлен обработчик NotFound
Исправлена опечатка в тесте
Разделена логика метода BuildNonElyTexturesHash
2016-07-06 14:45:14 +03:00

19 lines
345 B
Go

package routes
import (
"net/http"
"encoding/json"
)
func NotFound(w http.ResponseWriter, r *http.Request) {
json, _ := json.Marshal(map[string]string{
"status": "404",
"message": "Not Found",
"link": "http://docs.ely.by",
})
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusNotFound)
w.Write(json)
}