mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-22 15:10:13 +00:00
build/ci: Update Go to v1.24, golangci-lint to v1.64.6 and fix issues (#1804)
* build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues * Address shazbert's nitters * linter/config: Fix new linter issue and use versionSize const * Address gk's nitters and fix additional linter issue after rebase * Address glorious nits * staticcheck: Fix additional linter issues after upgrading to Go 1.24.1 and golangci-lint v1.64.6 Also addresses nits * Improve testing, assertify usage and use common.ErrParsingWSField * TestCreateNewStrategy: Replace must > should wording
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -227,22 +226,26 @@ func (b *Bithumb) GetAccountBalance(ctx context.Context, c string) (FullBalance,
|
||||
}
|
||||
|
||||
// Added due to increasing of the usable currencies on exchange, usually
|
||||
// without notificatation, so we dont need to update structs later on
|
||||
// without notification, so we dont need to update structs later on
|
||||
for tag, datum := range response.Data {
|
||||
splitTag := strings.Split(tag, "_")
|
||||
if len(splitTag) < 2 {
|
||||
return fullBalance, fmt.Errorf("unhandled tag format: %q", splitTag)
|
||||
}
|
||||
|
||||
c := splitTag[len(splitTag)-1]
|
||||
|
||||
var val float64
|
||||
if reflect.TypeOf(datum).String() != "float64" {
|
||||
val, err = strconv.ParseFloat(datum.(string), 64)
|
||||
switch v := datum.(type) {
|
||||
case float64:
|
||||
val = v
|
||||
case string:
|
||||
val, err = strconv.ParseFloat(v, 64)
|
||||
if err != nil {
|
||||
return fullBalance, err
|
||||
}
|
||||
} else {
|
||||
var ok bool
|
||||
val, ok = datum.(float64)
|
||||
if !ok {
|
||||
return fullBalance, common.GetTypeAssertError("float64", datum)
|
||||
}
|
||||
default:
|
||||
return fullBalance, common.GetTypeAssertError("float64|string", datum)
|
||||
}
|
||||
|
||||
switch splitTag[0] {
|
||||
|
||||
Reference in New Issue
Block a user