diff --git a/.golangci.yml b/.golangci.yml index c5a2335..e1f17b3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,12 @@ run: skip-dirs: - sandbox +linters-settings: + revive: + rules: + - name: if-return + severity: warning + disabled: true linters: enable: - errcheck @@ -8,3 +14,4 @@ linters: - govet - unused - gosimple + - revive diff --git a/spot_v1.go b/spot_v1.go index 93da657..d398022 100644 --- a/spot_v1.go +++ b/spot_v1.go @@ -466,12 +466,12 @@ type SpotGetOrderResponse struct { // SpotGetOrderResult : type SpotGetOrderResult struct { - AccountId string `json:"accountId"` - ExchangeId string `json:"exchangeId"` + AccountID string `json:"accountId"` + ExchangeID string `json:"exchangeId"` Symbol string `json:"symbol"` SymbolName string `json:"symbolName"` - OrderLinkId string `json:"orderLinkId"` - OrderId string `json:"orderId"` + OrderLinkID string `json:"orderLinkId"` + OrderID string `json:"orderId"` Price string `json:"price"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` @@ -518,11 +518,11 @@ type SpotDeleteOrderResponse struct { // SpotDeleteOrderResult : type SpotDeleteOrderResult struct { - OrderId string `json:"orderId"` - OrderLinkId string `json:"orderLinkId"` + OrderID string `json:"orderId"` + OrderLinkID string `json:"orderLinkId"` Symbol string `json:"symbol"` Status string `json:"status"` - AccountId string `json:"accountId"` + AccountID string `json:"accountId"` TransactTime string `json:"transactTime"` Price string `json:"price"` OrigQty string `json:"origQty"` diff --git a/v5_asset_service.go b/v5_asset_service.go index 577d2fd..4aafae9 100644 --- a/v5_asset_service.go +++ b/v5_asset_service.go @@ -268,7 +268,7 @@ type V5GetWithdrawalRecordsRows []V5GetWithdrawalRecordsRow // V5GetWithdrawalRecordsRow : type V5GetWithdrawalRecordsRow struct { - WithdrawId string `json:"withdrawId"` + WithdrawID string `json:"withdrawId"` TxID string `json:"txId"` WithdrawType WithdrawTypeV5 `json:"withdrawType"` Coin Coin `json:"coin"` @@ -361,7 +361,7 @@ func (s *V5AssetService) GetCoinInfo(param V5GetCoinInfoParam) (*V5GetCoinInfoRe // V5GetAllCoinsBalanceParam : type V5GetAllCoinsBalanceParam struct { AccountType AccountType `url:"accountType"` - MemberId string `url:"memberId,omitempty"` + MemberID string `url:"memberId,omitempty"` WithBonus string `url:"withBonus,omitempty"` Coins []Coin } @@ -374,7 +374,7 @@ type V5GetAllCoinsBalanceResponse struct { // V5GetAllCoinsBalanceResult : type V5GetAllCoinsBalanceResult struct { - MemberId string `json:"memberId"` + MemberID string `json:"memberId"` AccountType AccountType `json:"accountType"` Balance []*V5GetAllCoinsBalanceBalance `json:"balance"` } diff --git a/v5_execution_service.go b/v5_execution_service.go index 3691922..ca80fa5 100644 --- a/v5_execution_service.go +++ b/v5_execution_service.go @@ -17,8 +17,8 @@ type V5GetExecutionParam struct { Category CategoryV5 `url:"category"` Symbol *SymbolV5 `url:"symbol,omitempty"` - OrderId *string `url:"orderId,omitempty"` - OrderLinkId *string `url:"orderLinkId,omitempty"` + OrderID *string `url:"orderId,omitempty"` + OrderLinkID *string `url:"orderLinkId,omitempty"` BaseCoin *Coin `url:"baseCoin,omitempty"` StartTime *int `url:"startTime,omitempty"` EndTime *int `url:"endTime,omitempty"` @@ -44,7 +44,7 @@ type V5GetExecutionListResult struct { type V5GetExecutionListItem struct { Symbol SymbolV5 `json:"symbol"` OrderID string `json:"orderId"` - OrderLinkId string `json:"orderLinkId"` + OrderLinkID string `json:"orderLinkId"` Side Side `json:"side"` OrderPrice string `json:"orderPrice"` OrderQty string `json:"orderQty"` @@ -65,7 +65,7 @@ type V5GetExecutionListItem struct { MarkPrice string `json:"markPrice"` IndexPrice string `json:"indexPrice"` UnderlyingPrice string `json:"underlyingPrice"` - BlockTradeId string `json:"blockTradeId"` + BlockTradeID string `json:"blockTradeId"` ClosedSize string `json:"closedSize"` } diff --git a/v5_order_service_test.go b/v5_order_service_test.go index 92ac6c0..c102e90 100644 --- a/v5_order_service_test.go +++ b/v5_order_service_test.go @@ -160,11 +160,11 @@ func TestV5Order_AmendOrder(t *testing.T) { func TestV5Order_CancelOrder(t *testing.T) { t.Run("success", func(t *testing.T) { - orderId := "1358868270414852352" + orderID := "1358868270414852352" param := V5CancelOrderParam{ Category: CategoryV5Spot, Symbol: SymbolV5BTCUSDT, - OrderID: &orderId, + OrderID: &orderID, } path := "/v5/order/cancel" @@ -172,7 +172,7 @@ func TestV5Order_CancelOrder(t *testing.T) { status := http.StatusOK respBody := map[string]interface{}{ "result": map[string]interface{}{ - "orderId": orderId, + "orderId": orderID, "orderLinkId": "1676725721103693", }, } @@ -195,11 +195,11 @@ func TestV5Order_CancelOrder(t *testing.T) { testhelper.Compare(t, respBody["result"], resp.Result) }) t.Run("authentication required", func(t *testing.T) { - orderId := "1358868270414852352" + orderID := "1358868270414852352" param := V5CancelOrderParam{ Category: CategoryV5Spot, Symbol: SymbolV5BTCUSDT, - OrderID: &orderId, + OrderID: &orderID, } path := "/v5/order/cancel" @@ -207,7 +207,7 @@ func TestV5Order_CancelOrder(t *testing.T) { status := http.StatusOK respBody := map[string]interface{}{ "result": map[string]interface{}{ - "orderId": orderId, + "orderId": orderID, "orderLinkId": "1676725721103693", }, }