Add missing comment to GetReasonFromBody()

This commit is contained in:
pancho horrillo
2019-11-20 04:51:29 +01:00
parent b130cfdec7
commit b40f73115f
+2
View File
@@ -34,6 +34,8 @@ func GetReason(r *http.Response) string {
return "" return ""
} }
// GetReasonFromBody returns the reason phrase embedded within the JSON error
// body, or an error if no reason can be extracted
func GetReasonFromBody(r *http.Response) (string, error) { func GetReasonFromBody(r *http.Response) (string, error) {
body, err := ioutil.ReadAll(r.Body) body, err := ioutil.ReadAll(r.Body)
if err != nil { if err != nil {