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:
Adrian Gallagher
2025-03-10 16:33:55 +11:00
committed by GitHub
parent c086e281cf
commit d64d56f77c
114 changed files with 5080 additions and 9355 deletions

View File

@@ -58,12 +58,12 @@ type Request struct {
ProcessedCandles []Candle
// RequestLimit is the potential maximum amount of candles that can be
// returned
RequestLimit int64
RequestLimit uint64
}
// CreateKlineRequest generates a `Request` type for interval conversions
// supported by an exchange.
func CreateKlineRequest(name string, pair, formatted currency.Pair, a asset.Item, clientRequired, exchangeInterval Interval, start, end time.Time, specificEndpointLimit int64) (*Request, error) {
func CreateKlineRequest(name string, pair, formatted currency.Pair, a asset.Item, clientRequired, exchangeInterval Interval, start, end time.Time, specificEndpointLimit uint64) (*Request, error) {
if name == "" {
return nil, ErrUnsetName
}
@@ -132,7 +132,7 @@ func CreateKlineRequest(name string, pair, formatted currency.Pair, a asset.Item
// GetRanges returns the date ranges for candle intervals broken up over
// requests
func (r *Request) GetRanges(limit uint32) (*IntervalRangeHolder, error) {
func (r *Request) GetRanges(limit uint64) (*IntervalRangeHolder, error) {
if r == nil {
return nil, errNilRequest
}
@@ -193,12 +193,12 @@ func (r *Request) ProcessResponse(timeSeries []Candle) (*Item, error) {
}
// Size returns the max length of return for pre-allocation.
func (r *Request) Size() int {
func (r *Request) Size() uint64 {
if r == nil {
return 0
}
return int(TotalCandlesPerInterval(r.Start, r.End, r.ExchangeInterval))
return TotalCandlesPerInterval(r.Start, r.End, r.ExchangeInterval)
}
// ExtendedRequest used in extended functionality for when candles requested
@@ -236,12 +236,12 @@ func (r *ExtendedRequest) ProcessResponse(timeSeries []Candle) (*Item, error) {
}
// Size returns the max length of return for pre-allocation.
func (r *ExtendedRequest) Size() int {
func (r *ExtendedRequest) Size() uint64 {
if r == nil || r.RangeHolder == nil {
return 0
}
if r.RangeHolder.Limit == 0 {
log.Warnf(log.ExchangeSys, "%v candle request limit is zero while calling Size()", r.Exchange)
}
return r.RangeHolder.Limit * len(r.RangeHolder.Ranges)
return r.RangeHolder.Limit * uint64(len(r.RangeHolder.Ranges))
}