From 6a9511b1fec7009eafa2ef11d86d1aa07b9100c6 Mon Sep 17 00:00:00 2001 From: alingse Date: Fri, 22 Apr 2022 21:30:58 +0800 Subject: [PATCH] fix golang lint --- amazon/validator_test.go | 3 --- hms/modifier.go | 4 ++-- hms/validator.go | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/amazon/validator_test.go b/amazon/validator_test.go index 373ffc5..d5d2b0c 100644 --- a/amazon/validator_test.go +++ b/amazon/validator_test.go @@ -16,8 +16,6 @@ import ( func TestHandle497Error(t *testing.T) { t.Parallel() var expected, actual error - client := New("developerSecret") - server, client := testTools( 497, "{\"message\":\"Purchase token/app user mismatch\",\"status\":false}", @@ -39,7 +37,6 @@ func TestHandle497Error(t *testing.T) { func TestHandle400Error(t *testing.T) { t.Parallel() var expected, actual error - client := New("developerSecret") server, client := testTools( 400, diff --git a/hms/modifier.go b/hms/modifier.go index f5d4e35..4724220 100644 --- a/hms/modifier.go +++ b/hms/modifier.go @@ -73,8 +73,8 @@ func (c *Client) RevokeSubscription(ctx context.Context, purchaseToken, subscrip // ModifySubscriptionResponse JSON response from {rootUrl}/sub/applications/v2/purchases/stop|delay|returnFee|withdrawal type ModifySubscriptionResponse struct { ResponseCode string `json:"responseCode"` - ResponseMessage string `json:"responseMessage;omitempty"` - NewExpirationTime int64 `json:"newExpirationTime;omitempty"` + ResponseMessage string `json:"responseMessage,omitempty"` + NewExpirationTime int64 `json:"newExpirationTime,omitempty"` } // public method to query {rootUrl}/sub/applications/v2/purchases/stop|delay|returnFee|withdrawal diff --git a/hms/validator.go b/hms/validator.go index 1a2a6bc..7178b43 100644 --- a/hms/validator.go +++ b/hms/validator.go @@ -234,9 +234,11 @@ func (c *Client) GetCanceledOrRefundedPurchases( } url := c.getRootOrderURLByFlag(accountFlag) + "/applications/v2/purchases/cancelledList" - bodyBytes, err := c.sendJSONRequest(ctx, url, bodyMap) + var bodyBytes []byte + bodyBytes, err = c.sendJSONRequest(ctx, url, bodyMap) if err != nil { // log.Printf("GetCanceledOrRefundedPurchases(): Encounter error: %s", err) + return } var cpl CanceledPurchaseList // temporary variable to store api query result