From ad82535abbb8bebf6350d42eb9865b1c0db366cf Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 18 Nov 2017 03:50:08 +0100 Subject: [PATCH] Removed obsolete method NewApiError --- twitter.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/twitter.go b/twitter.go index 0a9902c..f2ffc6e 100644 --- a/twitter.go +++ b/twitter.go @@ -43,7 +43,6 @@ import ( "compress/zlib" "encoding/json" "fmt" - "io/ioutil" "net/http" "net/url" "strings" @@ -275,17 +274,6 @@ func decodeResponse(resp *http.Response, data interface{}) error { return json.NewDecoder(resp.Body).Decode(data) } -func NewApiError(resp *http.Response) *ApiError { - body, _ := ioutil.ReadAll(resp.Body) - - return &ApiError{ - StatusCode: resp.StatusCode, - Header: resp.Header, - Body: string(body), - URL: resp.Request.URL, - } -} - //query executes a query to the specified url, sending the values specified by form, and decodes the response JSON to data //method can be either _GET or _POST func (c TwitterApi) execQuery(urlStr string, form url.Values, data interface{}, method int) error {