mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-03 23:16:53 +00:00
common: Replace StringDataCompare with slices.Contains and cleanup string funcs (#1631)
* common: Replace StringDataCompare with slices.Contains and cleanup string funcs * common/docs: Update SliceDifference and remove outdated steps from ADD_NEW_EXCHANGE.md * common: Improve SliceDifference
This commit is contained in:
@@ -307,7 +307,7 @@ func checkMissingExchanges() []string {
|
||||
}
|
||||
supportedExchs := exchange.Exchanges
|
||||
for z := 0; z < len(supportedExchs); {
|
||||
if common.StringDataContainsInsensitive(tempArray, supportedExchs[z]) {
|
||||
if common.StringSliceContainsInsensitive(tempArray, supportedExchs[z]) {
|
||||
supportedExchs = append(supportedExchs[:z], supportedExchs[z+1:]...)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -51,14 +52,14 @@ func TestAllExchangeWrappers(t *testing.T) {
|
||||
name := strings.ToLower(cfg.Exchanges[i].Name)
|
||||
t.Run(name+" wrapper tests", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if common.StringDataContains(unsupportedExchangeNames, name) {
|
||||
if slices.Contains(unsupportedExchangeNames, name) {
|
||||
t.Skipf("skipping unsupported exchange %v", name)
|
||||
}
|
||||
if singleExchangeOverride != "" && name != singleExchangeOverride {
|
||||
t.Skip("skipping ", name, " due to override")
|
||||
}
|
||||
ctx := context.Background()
|
||||
if isCITest() && common.StringDataContains(blockedCIExchanges, name) {
|
||||
if isCITest() && slices.Contains(blockedCIExchanges, name) {
|
||||
// rather than skipping tests where execution is blocked, provide an expired
|
||||
// context, so no executions can take place
|
||||
var cancelFn context.CancelFunc
|
||||
|
||||
Reference in New Issue
Block a user