Files
kapow/http/reason.go
2019-10-02 16:20:39 +02:00

15 lines
195 B
Go

package http
import (
"net/http"
"strings"
)
func GetReason(r *http.Response) string {
if i := strings.IndexByte(r.Status, ' '); i != -1 {
return r.Status[i+1:]
} else {
return ""
}
}