From f02b706066774ea0c380d11a93049b3ae1e4217a Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 13 Dec 2017 16:41:04 +0500 Subject: [PATCH] :building_construction: Hide Response structure because it is not publicly used anywhere --- request.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/request.go b/request.go index d99fcda..33b7612 100644 --- a/request.go +++ b/request.go @@ -10,17 +10,17 @@ import ( http "github.com/valyala/fasthttp" ) -// Response represents a response from the Telegram API with the result stored raw. If ok equals true, +// response represents a response from the Telegram API with the result stored raw. If ok equals true, // the request was successful, and the result of the query can be found in the result field. In case of // an unsuccessful request, ok equals false, and the error is explained in the error field (e.g. // SHORT_NAME_REQUIRED). -type Response struct { +type response struct { Ok bool `json:"ok"` Error string `json:"error"` Result *gojson.RawMessage `json:"result"` } -func request(method, path string, args *http.Args) (*Response, error) { +func request(method, path string, args *http.Args) (*response, error) { requestURI := &url.URL{ Scheme: "https", Host: "api.telegra.ph", @@ -36,7 +36,7 @@ func request(method, path string, args *http.Args) (*Response, error) { return nil, err } - var resp Response + var resp response if err := json.Unmarshal(body, &resp); err != nil { return nil, err }