mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
golangci-lint/CI: Bump versions and introduce new linters (#798)
* golangci-lint/CI: Bump versions
Fix remaining linter issues
* Specifically set AppVeyor version
* Fix the infamous typos 👀
* Add go env cmd to AppVeyor
* Add go version cmd to AppVeyor
* Specify AppVeyor image, adjust linters
* Update go get to go install due to deprecation
* Bump golangci-lint timeout time for AppVeyor
* Change NW contract to NQ
* Address nitters
* GetRandomPair -> Pair{}
* Address nits
* Address time nitterinos plus additional tweaks
* More time inception upgrades!
* Bending time and space
This commit is contained in:
@@ -455,6 +455,7 @@ func TestGetDepositAddress(t *testing.T) {
|
||||
}
|
||||
}
|
||||
func setupWsAuth(t *testing.T) {
|
||||
t.Helper()
|
||||
if wsSetupRan {
|
||||
return
|
||||
}
|
||||
@@ -524,8 +525,7 @@ func TestWsReplaceOrder(t *testing.T) {
|
||||
// TestWsGetActiveOrders dials websocket, sends get active orders request.
|
||||
func TestWsGetActiveOrders(t *testing.T) {
|
||||
setupWsAuth(t)
|
||||
_, err := h.wsGetActiveOrders()
|
||||
if err != nil {
|
||||
if _, err := h.wsGetActiveOrders(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -533,8 +533,7 @@ func TestWsGetActiveOrders(t *testing.T) {
|
||||
// TestWsGetTradingBalance dials websocket, sends get trading balance request.
|
||||
func TestWsGetTradingBalance(t *testing.T) {
|
||||
setupWsAuth(t)
|
||||
_, err := h.wsGetTradingBalance()
|
||||
if err != nil {
|
||||
if _, err := h.wsGetTradingBalance(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,10 @@ func (h *HitBTC) wsGetTableName(respRaw []byte) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
data := resultType[0].(map[string]interface{})
|
||||
data, ok := resultType[0].(map[string]interface{})
|
||||
if !ok {
|
||||
return "", errors.New("unable to type assert data")
|
||||
}
|
||||
if _, ok := data["clientOrderId"]; ok {
|
||||
return "order", nil
|
||||
} else if _, ok := data["available"]; ok {
|
||||
|
||||
@@ -358,8 +358,7 @@ func (h *HitBTC) UpdateTickers(ctx context.Context, a asset.Item) error {
|
||||
|
||||
// UpdateTicker updates and returns the ticker for a currency pair
|
||||
func (h *HitBTC) UpdateTicker(ctx context.Context, p currency.Pair, a asset.Item) (*ticker.Price, error) {
|
||||
err := h.UpdateTickers(ctx, a)
|
||||
if err != nil {
|
||||
if err := h.UpdateTickers(ctx, a); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ticker.GetTicker(h.Name, p, a)
|
||||
@@ -498,8 +497,8 @@ allTrades:
|
||||
p.String(),
|
||||
"",
|
||||
"",
|
||||
ts.UnixNano()/int64(time.Millisecond),
|
||||
timestampEnd.UnixNano()/int64(time.Millisecond),
|
||||
ts.UnixMilli(),
|
||||
timestampEnd.UnixMilli(),
|
||||
int64(limit),
|
||||
0)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user