CI: Fix golangci-lint linter issues, add prealloc linter and bump version depends for Go 1.18 (#915)

* Bump CI versions

* Specifically set go version as 1.17.x bumps it to 1.18

* Another

* Adjust AppVeyor

* Part 1 of linter issues

* Part 2

* Fix various linters and improvements

* Part 3

* Finishing touches

* Tests and EqualFold

* Fix nitterinos plus bonus requester jobs bump for exchanges with large number of tests

* Fix nitterinos and bump golangci-lint timeout for AppVeyor

* Address nits, ensure all books are returned on err due to syncer regression

* Fix the wiggins

* Fix duplication

* Fix nitterinos
This commit is contained in:
Adrian Gallagher
2022-04-20 13:45:15 +10:00
committed by GitHub
parent c48e5ea90a
commit 9a4eb9de84
216 changed files with 3493 additions and 2424 deletions

View File

@@ -288,16 +288,20 @@ func (b *Bitflyer) UpdateOrderbook(ctx context.Context, p currency.Pair, assetTy
return book, err
}
book.Asks = make(orderbook.Items, len(orderbookNew.Asks))
for x := range orderbookNew.Asks {
book.Asks = append(book.Asks, orderbook.Item{
book.Asks[x] = orderbook.Item{
Price: orderbookNew.Asks[x].Price,
Amount: orderbookNew.Asks[x].Size})
Amount: orderbookNew.Asks[x].Size,
}
}
book.Bids = make(orderbook.Items, len(orderbookNew.Bids))
for x := range orderbookNew.Bids {
book.Bids = append(book.Bids, orderbook.Item{
book.Bids[x] = orderbook.Item{
Price: orderbookNew.Bids[x].Price,
Amount: orderbookNew.Bids[x].Size})
Amount: orderbookNew.Bids[x].Size,
}
}
err = book.Process()
@@ -346,7 +350,7 @@ func (b *Bitflyer) GetRecentTrades(ctx context.Context, p currency.Pair, assetTy
if err != nil {
return nil, err
}
var resp []trade.Data
resp := make([]trade.Data, len(tradeData))
for i := range tradeData {
var timestamp time.Time
timestamp, err = time.Parse("2006-01-02T15:04:05.999999999", tradeData[i].ExecDate)
@@ -358,7 +362,7 @@ func (b *Bitflyer) GetRecentTrades(ctx context.Context, p currency.Pair, assetTy
if err != nil {
return nil, err
}
resp = append(resp, trade.Data{
resp[i] = trade.Data{
TID: strconv.FormatInt(tradeData[i].ID, 10),
Exchange: b.Name,
CurrencyPair: p,
@@ -367,7 +371,7 @@ func (b *Bitflyer) GetRecentTrades(ctx context.Context, p currency.Pair, assetTy
Price: tradeData[i].Price,
Amount: tradeData[i].Size,
Timestamp: timestamp,
})
}
}
err = b.AddTradesToBuffer(resp...)