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

@@ -132,30 +132,28 @@ func (l *LakeBTC) GetTicker() (map[string]Ticker, error) {
result := make(map[string]Ticker)
var addresses []string
for k, v := range response {
var ticker Ticker
var tick Ticker
key := common.StringToUpper(k)
if v.Ask != nil {
ticker.Ask, _ = strconv.ParseFloat(v.Ask.(string), 64)
tick.Ask, _ = strconv.ParseFloat(v.Ask.(string), 64)
}
if v.Bid != nil {
ticker.Bid, _ = strconv.ParseFloat(v.Bid.(string), 64)
tick.Bid, _ = strconv.ParseFloat(v.Bid.(string), 64)
}
if v.High != nil {
ticker.High, _ = strconv.ParseFloat(v.High.(string), 64)
tick.High, _ = strconv.ParseFloat(v.High.(string), 64)
}
if v.Last != nil {
ticker.Last, _ = strconv.ParseFloat(v.Last.(string), 64)
tick.Last, _ = strconv.ParseFloat(v.Last.(string), 64)
}
if v.Low != nil {
ticker.Low, _ = strconv.ParseFloat(v.Low.(string), 64)
tick.Low, _ = strconv.ParseFloat(v.Low.(string), 64)
}
if v.Volume != nil {
ticker.Volume, _ = strconv.ParseFloat(v.Volume.(string), 64)
tick.Volume, _ = strconv.ParseFloat(v.Volume.(string), 64)
}
result[key] = ticker
addresses = append(addresses, key)
result[key] = tick
}
return result, nil
}
@@ -236,7 +234,7 @@ func (l *LakeBTC) Trade(isBuyOrder bool, amount, price float64, currency string)
}
if resp.Result != "order received" {
return resp, fmt.Errorf("Unexpected result: %s", resp.Result)
return resp, fmt.Errorf("unexpected result: %s", resp.Result)
}
return resp, nil

View File

@@ -117,13 +117,14 @@ func (l *LakeBTC) GetAccountInfo() (exchange.AccountInfo, error) {
var currencies []exchange.AccountCurrencyInfo
for x, y := range accountInfo.Balance {
for z, w := range accountInfo.Locked {
if z == x {
var exchangeCurrency exchange.AccountCurrencyInfo
exchangeCurrency.CurrencyName = common.StringToUpper(x)
exchangeCurrency.TotalValue, _ = strconv.ParseFloat(y, 64)
exchangeCurrency.Hold, _ = strconv.ParseFloat(w, 64)
currencies = append(currencies, exchangeCurrency)
if z != x {
continue
}
var exchangeCurrency exchange.AccountCurrencyInfo
exchangeCurrency.CurrencyName = common.StringToUpper(x)
exchangeCurrency.TotalValue, _ = strconv.ParseFloat(y, 64)
exchangeCurrency.Hold, _ = strconv.ParseFloat(w, 64)
currencies = append(currencies, exchangeCurrency)
}
}
@@ -227,7 +228,7 @@ func (l *LakeBTC) GetDepositAddress(cryptocurrency pair.CurrencyItem, _ string)
// submitted
func (l *LakeBTC) WithdrawCryptocurrencyFunds(withdrawRequest exchange.WithdrawRequest) (string, error) {
if withdrawRequest.Currency.String() != symbol.BTC {
return "", errors.New("Only BTC supported for withdrawals")
return "", errors.New("only BTC is supported for withdrawals")
}
resp, err := l.CreateWithdraw(withdrawRequest.Amount, withdrawRequest.Description)