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

@@ -2,7 +2,7 @@ package gct
// AllModuleNames returns a list of all default module names.
func AllModuleNames() []string {
var names []string
names := make([]string, 0, len(Modules))
for name := range Modules {
names = append(names, name)
}

View File

@@ -46,7 +46,7 @@ func ema(args ...objects.Object) (objects.Object, error) {
return nil, fmt.Errorf(modules.ErrParameterConvertFailed, OHLCV)
}
var ohlcvClose []float64
ohlcvClose := make([]float64, len(ohlcvInputData))
var allErrors []string
for x := range ohlcvInputData {
t, ok := ohlcvInputData[x].([]interface{})
@@ -61,7 +61,7 @@ func ema(args ...objects.Object) (objects.Object, error) {
if err != nil {
allErrors = append(allErrors, err.Error())
}
ohlcvClose = append(ohlcvClose, value)
ohlcvClose[x] = value
}
inTimePeriod, ok := objects.ToInt(args[1])

View File

@@ -47,7 +47,7 @@ func macd(args ...objects.Object) (objects.Object, error) {
return nil, fmt.Errorf(modules.ErrParameterConvertFailed, OHLCV)
}
var ohlcvClose []float64
ohlcvClose := make([]float64, len(ohlcvInputData))
var allErrors []string
for x := range ohlcvInputData {
t, ok := ohlcvInputData[x].([]interface{})
@@ -61,7 +61,7 @@ func macd(args ...objects.Object) (objects.Object, error) {
if err != nil {
allErrors = append(allErrors, err.Error())
}
ohlcvClose = append(ohlcvClose, value)
ohlcvClose[x] = value
}
inFastPeriod, ok := objects.ToInt(args[1])

View File

@@ -46,7 +46,7 @@ func rsi(args ...objects.Object) (objects.Object, error) {
return nil, fmt.Errorf(modules.ErrParameterConvertFailed, OHLCV)
}
var ohlcvClose []float64
ohlcvClose := make([]float64, len(ohlcvInputData))
var allErrors []string
for x := range ohlcvInputData {
t, ok := ohlcvInputData[x].([]interface{})
@@ -61,7 +61,7 @@ func rsi(args ...objects.Object) (objects.Object, error) {
if err != nil {
allErrors = append(allErrors, err.Error())
}
ohlcvClose = append(ohlcvClose, value)
ohlcvClose[x] = value
}
inTimePeriod, ok := objects.ToInt(args[1])

View File

@@ -46,7 +46,7 @@ func sma(args ...objects.Object) (objects.Object, error) {
return nil, fmt.Errorf(modules.ErrParameterConvertFailed, OHLCV)
}
var ohlcvClose []float64
ohlcvClose := make([]float64, len(ohlcvInputData))
var allErrors []string
for x := range ohlcvInputData {
t, ok := ohlcvInputData[x].([]interface{})
@@ -60,7 +60,7 @@ func sma(args ...objects.Object) (objects.Object, error) {
if err != nil {
allErrors = append(allErrors, err.Error())
}
ohlcvClose = append(ohlcvClose, value)
ohlcvClose[x] = value
}
inTimePeriod, ok := objects.ToInt(args[1])

View File

@@ -2,9 +2,9 @@ package ta
// AllModuleNames returns a list of all default module names.
func AllModuleNames() []string {
var names []string
for name := range Modules {
names = append(names, name)
names := make([]string, 0, len(Modules))
for x := range Modules {
names = append(names, x)
}
return names
}