golangci-lint: Enable usetesting and unused linters (#1893)

* golangci-lint: Enable usetesting and unused linters

* tests: Improve assertions in various test cases for clarity and accuracy

* tests: Enhance error assertions in TestExecuteStrategyFromFile for improved clarity

* tests: Update assertions for improved clarity and accuracy

* tests: Replace assert with require for task count checks

* config/versions/v7: Replace context.Background() with t.Context()

* Bithumb: Centralise and consoliate testPair, relax UpdateTickers check

with some glorious Doom Eternal music

* Bithumb: Use UpdatePairsOnce and update remaining pair string

* Bithumb: Add UpdatePairsOnce to TestUpdateTickers
This commit is contained in:
Adrian Gallagher
2025-05-01 14:44:29 +10:00
committed by GitHub
parent c2d876d8b0
commit bea16af380
69 changed files with 3253 additions and 3681 deletions

View File

@@ -1,7 +1,6 @@
package engine
import (
"context"
"errors"
"os"
"slices"
@@ -380,7 +379,7 @@ func TestGetDefaultConfigurations(t *testing.T) {
t.Skipf("skipping %s unsupported", name)
}
defaultCfg, err := exchange.GetDefaultConfig(context.Background(), exch)
defaultCfg, err := exchange.GetDefaultConfig(t.Context(), exch)
require.NoError(t, err, "GetDefaultConfig must not error")
require.NotNil(t, defaultCfg)
assert.NotEmpty(t, defaultCfg.Name, "Name should not be empty")
@@ -480,7 +479,7 @@ func TestSetupExchanges(t *testing.T) {
exchLoader := func(exch exchange.IBotExchange) {
exch.SetDefaults()
exch.GetBase().Features.Supports.RESTCapabilities.AutoPairUpdates = false
cfg, err := exchange.GetDefaultConfig(context.Background(), exch)
cfg, err := exchange.GetDefaultConfig(t.Context(), exch)
require.NoError(t, err)
e.Config.Exchanges = append(e.Config.Exchanges, *cfg)
}