Migrate from gometalinter.v2 to golangci-lint (#249)

* Migrate from gometalinter.v2 to golangci-lint
This commit is contained in:
Adrian Gallagher
2019-03-01 16:10:29 +11:00
committed by GitHub
parent 81852f2e01
commit 7dcb1ab553
133 changed files with 2179 additions and 2204 deletions

View File

@@ -159,19 +159,19 @@ func (b *Bittrex) GetCurrencies() (Currency, error) {
// GetTicker sends a public get request and returns current ticker information
// on the supplied currency. Example currency input param "btc-ltc".
func (b *Bittrex) GetTicker(currencyPair string) (Ticker, error) {
ticker := Ticker{}
tick := Ticker{}
path := fmt.Sprintf("%s/%s?market=%s", b.APIUrl, bittrexAPIGetTicker,
common.StringToUpper(currencyPair),
)
if err := b.SendHTTPRequest(path, &ticker); err != nil {
return ticker, err
if err := b.SendHTTPRequest(path, &tick); err != nil {
return tick, err
}
if !ticker.Success {
return ticker, errors.New(ticker.Message)
if !tick.Success {
return tick, errors.New(tick.Message)
}
return ticker, nil
return tick, nil
}
// GetMarketSummaries is used to get the last 24 hour summary of all active
@@ -553,8 +553,7 @@ func (b *Bittrex) GetWithdrawalFee(currency string) (float64, error) {
}
// calculateTradingFee returns the fee for trading any currency on Bittrex
func calculateTradingFee(purchasePrice float64, amount float64) float64 {
func calculateTradingFee(purchasePrice, amount float64) float64 {
var fee = 0.0025
return fee * purchasePrice * amount
}

View File

@@ -100,16 +100,17 @@ func (b *Bittrex) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Pr
for _, x := range b.GetEnabledCurrencies() {
curr := exchange.FormatExchangeCurrency(b.Name, x)
for y := range tick.Result {
if tick.Result[y].MarketName == curr.String() {
tickerPrice.Pair = x
tickerPrice.High = tick.Result[y].High
tickerPrice.Low = tick.Result[y].Low
tickerPrice.Ask = tick.Result[y].Ask
tickerPrice.Bid = tick.Result[y].Bid
tickerPrice.Last = tick.Result[y].Last
tickerPrice.Volume = tick.Result[y].Volume
ticker.ProcessTicker(b.GetName(), x, tickerPrice, assetType)
if tick.Result[y].MarketName != curr.String() {
continue
}
tickerPrice.Pair = x
tickerPrice.High = tick.Result[y].High
tickerPrice.Low = tick.Result[y].Low
tickerPrice.Ask = tick.Result[y].Ask
tickerPrice.Bid = tick.Result[y].Bid
tickerPrice.Last = tick.Result[y].Last
tickerPrice.Volume = tick.Result[y].Volume
ticker.ProcessTicker(b.GetName(), x, tickerPrice, assetType)
}
}
return ticker.GetTicker(b.Name, p, assetType)