Rename GetReasonFromBody() to simply Reason()

See ¹ for the customary idiomatic way of naming getters in Go.

¹: https://golang.org/doc/effective_go.html#Getters
This commit is contained in:
pancho horrillo
2019-11-20 05:04:10 +01:00
parent 3a47b34bc1
commit 75b0908b16
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ func Request(method string, url string, contentType string, r io.Reader, w io.Wr
defer res.Body.Close()
if res.StatusCode < 200 || res.StatusCode >= 300 {
reason, err := GetReasonFromBody(res)
reason, err := Reason(res)
if err != nil {
return err
}