From b40f73115f0e4a8e169458b16d2e647baf176f27 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Wed, 20 Nov 2019 04:51:29 +0100 Subject: [PATCH] Add missing comment to GetReasonFromBody() --- internal/http/reason.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/http/reason.go b/internal/http/reason.go index 7851d5f..417f8da 100644 --- a/internal/http/reason.go +++ b/internal/http/reason.go @@ -34,6 +34,8 @@ func GetReason(r *http.Response) string { 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) { body, err := ioutil.ReadAll(r.Body) if err != nil {