From 141c2474824e8f39e4d39cbeba9630548f6e21c5 Mon Sep 17 00:00:00 2001 From: Ruslan Efanov Date: Fri, 9 Dec 2022 11:40:52 +0300 Subject: [PATCH] fix linter errors --- client.go | 2 +- client_test.go | 6 +++--- response.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 65b15c9..6583b82 100644 --- a/client.go +++ b/client.go @@ -18,7 +18,7 @@ import ( ) // HTTPStatusUnknown can return for the method `/api/v5/customers/upload`, `/api/v5/customers-corporate/upload`, -// `/api/v5/orders/upload` +// `/api/v5/orders/upload`. const HTTPStatusUnknown = 460 // New initialize client. diff --git a/client_test.go b/client_test.go index e6eaaf6..db426fa 100644 --- a/client_test.go +++ b/client_test.go @@ -578,7 +578,7 @@ func TestClient_CustomersUpload_Fail(t *testing.T) { assert.Equal(t, HTTPStatusUnknown, status) assert.Equal(t, fmt.Sprintf("%d", iCodeFail), data.FailedCustomers[0].ExternalID) assert.Equal(t, "Customers are loaded with errors", err.Error()) - assert.Equal(t, "Something went wrong", err.(APIError).Errors()["managerId"]) + assert.Equal(t, "Something went wrong", err.(APIError).Errors()["managerId"]) //nolint:errorlint } func TestClient_CustomersCombine(t *testing.T) { @@ -1230,7 +1230,7 @@ func TestClient_CorporateCustomersUpload_Fail(t *testing.T) { assert.Equal(t, HTTPStatusUnknown, status) assert.Equal(t, fmt.Sprintf("%d", iCodeFail), data.FailedCustomers[0].ExternalID) assert.Equal(t, "Customers are loaded with errors", err.Error()) - assert.Equal(t, "Something went wrong", err.(APIError).Errors()["managerId"]) + assert.Equal(t, "Something went wrong", err.(APIError).Errors()["managerId"]) //nolint:errorlint } func TestClient_CorporateCustomer(t *testing.T) { @@ -2286,7 +2286,7 @@ func TestClient_OrdersUpload_Fail(t *testing.T) { assert.Equal(t, HTTPStatusUnknown, status) assert.Equal(t, fmt.Sprintf("%d", iCodeFail), data.FailedOrders[0].ExternalID) assert.Equal(t, "Orders are loaded with errors", err.Error()) - assert.Equal(t, "items[0].offer.id: Offer with id 123123 not found.", err.(APIError).Errors()["0"]) + assert.Equal(t, "items[0].offer.id: Offer with id 123123 not found.", err.(APIError).Errors()["0"]) //nolint:errorlint } func TestClient_OrdersCombine(t *testing.T) { diff --git a/response.go b/response.go index 6ee0add..501d01a 100644 --- a/response.go +++ b/response.go @@ -616,7 +616,7 @@ type LoyaltyBonusDetailsResponse struct { SuccessfulResponse Pagination `json:"pagination"` Statistic LoyaltyBonusStatisticResponse `json:"statistic"` - Bonuses []BonusDetail `json:"bonuses"` + Bonuses []BonusDetail `json:"bonuses,omitempty"` } type LoyaltyBonusStatisticResponse struct {