mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 23:16:54 +00:00
CI/build: Update Go version, linters and fix minor issues (#1473)
* CI/build: Update Go version, linters and fix minor issues * Bump golangci-lint to v1.56.1 * BinanceUS: Make uint usage consistent * Throw blank identifiers into the trash
This commit is contained in:
@@ -1814,7 +1814,7 @@ func (b *Bitfinex) GetBalanceHistory(ctx context.Context, symbol string, timeSin
|
||||
if limit > 0 {
|
||||
req["limit"] = limit
|
||||
}
|
||||
if len(wallet) > 0 {
|
||||
if wallet != "" {
|
||||
req["wallet"] = wallet
|
||||
}
|
||||
|
||||
@@ -1831,7 +1831,7 @@ func (b *Bitfinex) GetMovementHistory(ctx context.Context, symbol, method string
|
||||
req := make(map[string]interface{})
|
||||
req["currency"] = symbol
|
||||
|
||||
if len(method) > 0 {
|
||||
if method != "" {
|
||||
req["method"] = method
|
||||
}
|
||||
if !timeSince.IsZero() {
|
||||
@@ -2301,22 +2301,22 @@ func (b *Bitfinex) PopulateAcceptableMethods(ctx context.Context) error {
|
||||
storeData := make(map[string][]string)
|
||||
for x := range data {
|
||||
if len(data[x]) == 0 {
|
||||
return fmt.Errorf("data should not be empty")
|
||||
return errors.New("data should not be empty")
|
||||
}
|
||||
name, ok := data[x][0].(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to type assert name")
|
||||
return errors.New("unable to type assert name")
|
||||
}
|
||||
|
||||
var availOptions []string
|
||||
options, ok := data[x][1].([]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to type assert options")
|
||||
return errors.New("unable to type assert options")
|
||||
}
|
||||
for x := range options {
|
||||
o, ok := options[x].(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to type assert option to string")
|
||||
return errors.New("unable to type assert option to string")
|
||||
}
|
||||
availOptions = append(availOptions, o)
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,7 @@ func (b *Bitfinex) AuthenticateWebsocket(ctx context.Context) error {
|
||||
|
||||
// appendOptionalDelimiter ensures that a delimiter is present for long character currencies
|
||||
func (b *Bitfinex) appendOptionalDelimiter(p *currency.Pair) {
|
||||
if (len(p.Base.String()) > 3 && len(p.Quote.String()) > 0) ||
|
||||
if (len(p.Base.String()) > 3 && !p.Quote.IsEmpty()) ||
|
||||
len(p.Quote.String()) > 3 {
|
||||
p.Delimiter = ":"
|
||||
}
|
||||
@@ -1247,7 +1247,7 @@ func (b *Bitfinex) GetAvailableTransferChains(ctx context.Context, cryptocurrenc
|
||||
|
||||
availChains := acceptableMethods.lookup(cryptocurrency)
|
||||
if len(availChains) == 0 {
|
||||
return nil, fmt.Errorf("unable to find any available chains")
|
||||
return nil, errors.New("unable to find any available chains")
|
||||
}
|
||||
return availChains, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user