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

@@ -76,16 +76,17 @@ func (b *Binance) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Pr
for _, x := range b.GetEnabledCurrencies() {
curr := exchange.FormatExchangeCurrency(b.Name, x)
for y := range tick {
if tick[y].Symbol == curr.String() {
tickerPrice.Pair = x
tickerPrice.Ask = tick[y].AskPrice
tickerPrice.Bid = tick[y].BidPrice
tickerPrice.High = tick[y].HighPrice
tickerPrice.Last = tick[y].LastPrice
tickerPrice.Low = tick[y].LowPrice
tickerPrice.Volume = tick[y].Volume
ticker.ProcessTicker(b.Name, x, tickerPrice, assetType)
if tick[y].Symbol != curr.String() {
continue
}
tickerPrice.Pair = x
tickerPrice.Ask = tick[y].AskPrice
tickerPrice.Bid = tick[y].BidPrice
tickerPrice.High = tick[y].HighPrice
tickerPrice.Last = tick[y].LastPrice
tickerPrice.Low = tick[y].LowPrice
tickerPrice.Volume = tick[y].Volume
ticker.ProcessTicker(b.Name, x, tickerPrice, assetType)
}
}
return ticker.GetTicker(b.Name, p, assetType)
@@ -192,13 +193,14 @@ func (b *Binance) SubmitOrder(p pair.CurrencyPair, side exchange.OrderSide, orde
}
var requestParamsOrderType RequestParamsOrderType
if orderType == exchange.MarketOrderType {
switch orderType {
case exchange.MarketOrderType:
requestParamsOrderType = BinanceRequestParamsOrderMarket
} else if orderType == exchange.LimitOrderType {
case exchange.LimitOrderType:
requestParamsOrderType = BinanceRequestParamsOrderLimit
} else {
default:
submitOrderResponse.IsOrderPlaced = false
return submitOrderResponse, errors.New("Unsupported order type")
return submitOrderResponse, errors.New("unsupported order type")
}
var orderRequest = NewOrderRequest{
@@ -306,8 +308,8 @@ func (b *Binance) GetFeeByType(feeBuilder exchange.FeeBuilder) (float64, error)
// GetActiveOrders retrieves any orders that are active/open
func (b *Binance) GetActiveOrders(getOrdersRequest exchange.GetOrdersRequest) ([]exchange.OrderDetail, error) {
if len(getOrdersRequest.Currencies) <= 0 {
return nil, errors.New("At least one currency is required to fetch order history")
if len(getOrdersRequest.Currencies) == 0 {
return nil, errors.New("at least one currency is required to fetch order history")
}
var orders []exchange.OrderDetail
@@ -346,8 +348,8 @@ func (b *Binance) GetActiveOrders(getOrdersRequest exchange.GetOrdersRequest) ([
// GetOrderHistory retrieves account order information
// Can Limit response to specific order status
func (b *Binance) GetOrderHistory(getOrdersRequest exchange.GetOrdersRequest) ([]exchange.OrderDetail, error) {
if len(getOrdersRequest.Currencies) <= 0 {
return nil, errors.New("At least one currency is required to fetch order history")
if len(getOrdersRequest.Currencies) == 0 {
return nil, errors.New("at least one currency is required to fetch order history")
}
var orders []exchange.OrderDetail