mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 07:26:53 +00:00
Optimisation: Large struct pointer conversion (final part) (#265)
Completes large struct pointer optomisations over the entire codebase and enables hugeParams linter by default
This commit is contained in:
@@ -101,7 +101,7 @@ func (b *Binance) SetDefaults() {
|
||||
}
|
||||
|
||||
// Setup takes in the supplied exchange configuration details and sets params
|
||||
func (b *Binance) Setup(exch config.ExchangeConfig) {
|
||||
func (b *Binance) Setup(exch *config.ExchangeConfig) {
|
||||
if !exch.Enabled {
|
||||
b.SetEnabled(false)
|
||||
} else {
|
||||
@@ -127,7 +127,7 @@ func (b *Binance) Setup(exch config.ExchangeConfig) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = b.SetAPIURL(&exch)
|
||||
err = b.SetAPIURL(exch)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestSetup(t *testing.T) {
|
||||
binanceConfig.AuthenticatedAPISupport = true
|
||||
binanceConfig.APIKey = testAPIKey
|
||||
binanceConfig.APISecret = testAPISecret
|
||||
b.Setup(binanceConfig)
|
||||
b.Setup(&binanceConfig)
|
||||
}
|
||||
|
||||
func TestGetExchangeValidCurrencyPairs(t *testing.T) {
|
||||
|
||||
@@ -98,7 +98,7 @@ func (b *Binance) UpdateTicker(p currency.Pair, assetType string) (ticker.Price,
|
||||
tickerPrice.Last = tick[y].LastPrice
|
||||
tickerPrice.Low = tick[y].LowPrice
|
||||
tickerPrice.Volume = tick[y].Volume
|
||||
ticker.ProcessTicker(b.Name, tickerPrice, assetType)
|
||||
ticker.ProcessTicker(b.Name, &tickerPrice, assetType)
|
||||
}
|
||||
}
|
||||
return ticker.GetTicker(b.Name, p, assetType)
|
||||
|
||||
Reference in New Issue
Block a user