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:
Adrian Gallagher
2024-02-14 11:02:06 +11:00
committed by GitHub
parent 9ff502bac2
commit 08da42ddb7
79 changed files with 364 additions and 374 deletions

View File

@@ -550,7 +550,7 @@ func addExch(exchName, checkType string, data interface{}, isUpdate bool) error
}
if canUpdateTrello() {
if !isUpdate {
err := trelloCreateNewCheck(fmt.Sprintf("%s 1", exchName))
err := trelloCreateNewCheck(exchName + " 1")
if err != nil {
return err
}
@@ -1187,7 +1187,7 @@ func nameStateChanges(currentName, currentState string) (string, error) {
}
name = fmt.Sprintf("%s %s", strings.Split(currentName, " ")[0], strings.Split(currentName, " ")[1])
if !exists {
return fmt.Sprintf("%s 1", name), nil
return name + " 1", nil
}
num, err = strconv.ParseInt(strings.Split(currentName, " ")[2], 10, 64)
if err != nil {
@@ -1198,7 +1198,7 @@ func nameStateChanges(currentName, currentState string) (string, error) {
exists = true
name = strings.Split(currentName, " ")[0]
if !exists {
return fmt.Sprintf("%s 1", name), nil
return name + " 1", nil
}
num, err = strconv.ParseInt(strings.Split(currentName, " ")[1], 10, 64)
if err != nil {
@@ -1206,7 +1206,7 @@ func nameStateChanges(currentName, currentState string) (string, error) {
}
}
if !exists {
return fmt.Sprintf("%s 1", name), nil
return name + " 1", nil
}
}

View File

@@ -1775,7 +1775,7 @@ func cancelOrder(c *cli.Context) error {
// pair is optional, but if it's set, do a validity check
var p currency.Pair
if len(currencyPair) > 0 {
if currencyPair != "" {
if !validPair(currencyPair) {
return errInvalidPair
}
@@ -1917,7 +1917,7 @@ func cancelBatchOrders(c *cli.Context) error {
// pair is optional, but if it's set, do a validity check
var p currency.Pair
if len(currencyPair) > 0 {
if currencyPair != "" {
if !validPair(currencyPair) {
return errInvalidPair
}
@@ -2208,19 +2208,19 @@ func addEvent(c *cli.Context) error {
if c.IsSet("exchange") {
exchangeName = c.String("exchange")
} else {
return fmt.Errorf("exchange name is required")
return errors.New("exchange name is required")
}
if c.IsSet("item") {
item = c.String("item")
} else {
return fmt.Errorf("item is required")
return errors.New("item is required")
}
if c.IsSet("condition") {
condition = c.String("condition")
} else {
return fmt.Errorf("condition is required")
return errors.New("condition is required")
}
if c.IsSet("price") {
@@ -2242,7 +2242,7 @@ func addEvent(c *cli.Context) error {
if c.IsSet("pair") {
currencyPair = c.String("pair")
} else {
return fmt.Errorf("currency pair is required")
return errors.New("currency pair is required")
}
if !validPair(currencyPair) {
@@ -2261,7 +2261,7 @@ func addEvent(c *cli.Context) error {
if c.IsSet("action") {
action = c.String("action")
} else {
return fmt.Errorf("action is required")
return errors.New("action is required")
}
p, err := currency.NewPairDelimiter(currencyPair, pairDelimiter)