mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +00:00
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:
@@ -184,9 +184,9 @@ func TestInformationRatio(t *testing.T) {
|
||||
t.Error(avgComparison)
|
||||
}
|
||||
|
||||
var eachDiff []float64
|
||||
eachDiff := make([]float64, len(figures))
|
||||
for i := range figures {
|
||||
eachDiff = append(eachDiff, figures[i]-comparisonFigures[i])
|
||||
eachDiff[i] = figures[i] - comparisonFigures[i]
|
||||
}
|
||||
stdDev, err := PopulationStandardDeviation(eachDiff)
|
||||
if err != nil {
|
||||
@@ -583,9 +583,9 @@ func TestDecimalInformationRatio(t *testing.T) {
|
||||
t.Error(avgComparison)
|
||||
}
|
||||
|
||||
var eachDiff []decimal.Decimal
|
||||
eachDiff := make([]decimal.Decimal, len(figures))
|
||||
for i := range figures {
|
||||
eachDiff = append(eachDiff, figures[i].Sub(comparisonFigures[i]))
|
||||
eachDiff[i] = figures[i].Sub(comparisonFigures[i])
|
||||
}
|
||||
stdDev, err := DecimalPopulationStandardDeviation(eachDiff)
|
||||
if err != nil && !errors.Is(err, ErrInexactConversion) {
|
||||
@@ -703,14 +703,13 @@ func TestDecimalStandardDeviation2(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
var superMean []decimal.Decimal
|
||||
superMean := make([]decimal.Decimal, len(r))
|
||||
for i := range r {
|
||||
result := r[i].Sub(mean).Pow(decimal.NewFromInt(2))
|
||||
superMean = append(superMean, result)
|
||||
superMean[i] = result
|
||||
}
|
||||
superMeany := superMean[0].Add(superMean[1].Add(superMean[2].Add(superMean[3].Add(superMean[4].Add(superMean[5]))))).Div(decimal.NewFromInt(5))
|
||||
fSuperMeany, _ := superMeany.Float64()
|
||||
manualCalculation := decimal.NewFromFloat(math.Sqrt(fSuperMeany))
|
||||
manualCalculation := decimal.NewFromFloat(math.Sqrt(superMeany.InexactFloat64()))
|
||||
var codeCalcu decimal.Decimal
|
||||
codeCalcu, err = DecimalSampleStandardDeviation(r)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user