CI: Fix golangci-lint linter issues, add prealloc linter and bump version depends for Go 1.18 (#915)

* Bump CI versions

* Specifically set go version as 1.17.x bumps it to 1.18

* Another

* Adjust AppVeyor

* Part 1 of linter issues

* Part 2

* Fix various linters and improvements

* Part 3

* Finishing touches

* Tests and EqualFold

* Fix nitterinos plus bonus requester jobs bump for exchanges with large number of tests

* Fix nitterinos and bump golangci-lint timeout for AppVeyor

* Address nits, ensure all books are returned on err due to syncer regression

* Fix the wiggins

* Fix duplication

* Fix nitterinos
This commit is contained in:
Adrian Gallagher
2022-04-20 13:45:15 +10:00
committed by GitHub
parent c48e5ea90a
commit 9a4eb9de84
216 changed files with 3493 additions and 2424 deletions

View File

@@ -214,9 +214,9 @@ func (e *MultiPositionTracker) GetPositions() []PositionStats {
}
e.m.Lock()
defer e.m.Unlock()
var resp []PositionStats
resp := make([]PositionStats, len(e.positions))
for i := range e.positions {
resp = append(resp, e.positions[i].GetStats())
resp[i] = e.positions[i].GetStats()
}
return resp
}

View File

@@ -404,7 +404,5 @@ func (l *Limits) ConformToAmount(amount float64) float64 {
// derive modulus
mod := dAmount.Mod(dStep)
// subtract modulus to get the floor
rVal := dAmount.Sub(mod)
fVal, _ := rVal.Float64()
return fVal
return dAmount.Sub(mod).InexactFloat64()
}

View File

@@ -483,7 +483,7 @@ func (t Type) Lower() string {
// Title returns the type titleized, eg "Limit"
func (t Type) Title() string {
return strings.Title(strings.ToLower(string(t)))
return strings.Title(strings.ToLower(string(t))) // nolint:staticcheck // Ignore Title usage warning
}
// String implements the stringer interface
@@ -498,7 +498,7 @@ func (s Side) Lower() string {
// Title returns the side titleized, eg "Buy"
func (s Side) Title() string {
return strings.Title(strings.ToLower(string(s)))
return strings.Title(strings.ToLower(string(s))) // nolint:staticcheck // Ignore Title usage warning
}
// IsShort returns if the side is short