All checks were successful
gitea-deepak/gogmagog/pipeline/head This commit looks good
28 lines
696 B
Go
28 lines
696 B
Go
package routes
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func serverError(w http.ResponseWriter, err error) {
|
|
code := http.StatusInternalServerError
|
|
log.Printf("received error: {%v}", err)
|
|
http.Error(w, http.StatusText(code), code)
|
|
}
|
|
|
|
func badRequestError(w http.ResponseWriter, err error) {
|
|
code := http.StatusBadRequest
|
|
log.Printf("received error: {%v}", err)
|
|
http.Error(w, http.StatusText(code), code)
|
|
}
|
|
|
|
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) {
|
|
code := http.StatusMethodNotAllowed
|
|
http.Error(w, http.StatusText(code), code)
|
|
}
|
|
func notFoundHandler(w http.ResponseWriter, r *http.Request) {
|
|
code := http.StatusNotFound
|
|
http.Error(w, http.StatusText(code), code)
|
|
}
|