🏗️ Hide Response structure because it is not publicly used anywhere

This commit is contained in:
Maxim Lebedev 2017-12-13 16:41:04 +05:00
parent fa8b7ccd77
commit f02b706066
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
1 changed files with 4 additions and 4 deletions

View File

@ -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
}