Removed redundant error handling

This commit is contained in:
Jumpei Tsuji
2016-07-28 18:05:27 +09:00
parent f0c4457a10
commit a32b701d7b
2 changed files with 1 additions and 20 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"os"
"strconv"
"strings"
"time"
@@ -101,7 +100,7 @@ func NewWithConfig(config Config) Client {
// Verify sends receipts and gets validation result
func (c *Client) Verify(req IAPRequest) (IAPResponse, error) {
result := IAPResponse{}
res, body, errs := gorequest.New().
_, body, errs := gorequest.New().
Post(c.URL).
Send(req).
Timeout(c.TimeOut).
@@ -110,9 +109,6 @@ func (c *Client) Verify(req IAPRequest) (IAPResponse, error) {
if errs != nil {
return result, fmt.Errorf("%v", errs)
}
if res.StatusCode < 200 || res.StatusCode >= 300 {
return result, errors.New("An error occurred in IAP - code:" + strconv.Itoa(res.StatusCode))
}
err := json.NewDecoder(strings.NewReader(body)).Decode(&result)