mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 15:11:10 +00:00
Migrate from gometalinter.v2 to golangci-lint (#249)
* Migrate from gometalinter.v2 to golangci-lint
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/thrasher-/gocryptotrader/exchanges/ticker"
|
||||
)
|
||||
|
||||
//global vars contain staged update data that will be sent to the communication
|
||||
// global vars contain staged update data that will be sent to the communication
|
||||
// mediums
|
||||
var (
|
||||
TickerStaged map[string]map[string]map[string]ticker.Price
|
||||
@@ -92,9 +92,9 @@ func (b *Base) GetTicker(exchangeName string) string {
|
||||
}
|
||||
|
||||
var tickerPrices []ticker.Price
|
||||
for _, x := range tickerPrice {
|
||||
for _, y := range x {
|
||||
tickerPrices = append(tickerPrices, y)
|
||||
for x := range tickerPrice {
|
||||
for y := range tickerPrice[x] {
|
||||
tickerPrices = append(tickerPrices, tickerPrice[x][y])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ type IComm []ICommunicate
|
||||
|
||||
// ICommunicate enforces standard functions across communication packages
|
||||
type ICommunicate interface {
|
||||
Setup(config config.CommunicationsConfig)
|
||||
Setup(config *config.CommunicationsConfig)
|
||||
Connect() error
|
||||
PushEvent(Event) error
|
||||
IsEnabled() bool
|
||||
@@ -68,7 +68,7 @@ func (c IComm) GetEnabledCommunicationMediums() {
|
||||
}
|
||||
|
||||
// StageTickerData stages updated ticker data for the communications package
|
||||
func (c IComm) StageTickerData(exchangeName, assetType string, tickerPrice ticker.Price) {
|
||||
func (c IComm) StageTickerData(exchangeName, assetType string, tickerPrice *ticker.Price) {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
@@ -80,12 +80,12 @@ func (c IComm) StageTickerData(exchangeName, assetType string, tickerPrice ticke
|
||||
TickerStaged[exchangeName][assetType] = make(map[string]ticker.Price)
|
||||
}
|
||||
|
||||
TickerStaged[exchangeName][assetType][tickerPrice.CurrencyPair] = tickerPrice
|
||||
TickerStaged[exchangeName][assetType][tickerPrice.CurrencyPair] = *tickerPrice
|
||||
}
|
||||
|
||||
// StageOrderbookData stages updated orderbook data for the communications
|
||||
// package
|
||||
func (c IComm) StageOrderbookData(exchangeName, assetType string, orderbook orderbook.Base) {
|
||||
func (c IComm) StageOrderbookData(exchangeName, assetType string, ob *orderbook.Base) {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
@@ -97,12 +97,12 @@ func (c IComm) StageOrderbookData(exchangeName, assetType string, orderbook orde
|
||||
OrderbookStaged[exchangeName][assetType] = make(map[string]Orderbook)
|
||||
}
|
||||
|
||||
_, totalAsks := orderbook.CalculateTotalAsks()
|
||||
_, totalBids := orderbook.CalculateTotalBids()
|
||||
_, totalAsks := ob.CalculateTotalAsks()
|
||||
_, totalBids := ob.CalculateTotalBids()
|
||||
|
||||
OrderbookStaged[exchangeName][assetType][orderbook.CurrencyPair] = Orderbook{
|
||||
CurrencyPair: orderbook.CurrencyPair,
|
||||
OrderbookStaged[exchangeName][assetType][ob.CurrencyPair] = Orderbook{
|
||||
CurrencyPair: ob.CurrencyPair,
|
||||
TotalAsks: totalAsks,
|
||||
TotalBids: totalBids,
|
||||
LastUpdated: orderbook.LastUpdated.String()}
|
||||
LastUpdated: ob.LastUpdated.String()}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user