mirror of
https://github.com/1f349/violet.git
synced 2024-11-22 03:11:44 +00:00
12 lines
263 B
Go
12 lines
263 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// RespondHttpStatus outputs the status code and text using http.Error()
|
|
func RespondHttpStatus(rw http.ResponseWriter, status int) {
|
|
http.Error(rw, fmt.Sprintf("%d %s\n", status, http.StatusText(status)), status)
|
|
}
|