middleware/query/response.go
2024-01-07 06:00:59 +03:00

11 lines
234 B
Go

package query
import (
"net/http"
)
func RespondWithBadRequest(w http.ResponseWriter, _ *http.Request, err error) {
text := http.StatusText(http.StatusBadRequest) + ": " + err.Error()
http.Error(w, text, http.StatusBadRequest)
}