mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-22 07:26:50 +00:00
gocritic: linter silence (#796)
This commit is contained in:
@@ -1600,6 +1600,7 @@ func TestCheckExchangeConfigValues(t *testing.T) {
|
||||
}
|
||||
|
||||
// Make a sneaky copy for bank account testing
|
||||
// nolint: gocritic
|
||||
cpy := append(cfg.Exchanges[:0:0], cfg.Exchanges...)
|
||||
|
||||
// Test empty exchange name for an enabled exchange
|
||||
|
||||
@@ -4,6 +4,11 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Base enforces standard variables across the provider packages
|
||||
type Base struct {
|
||||
Settings `json:"settings"`
|
||||
}
|
||||
|
||||
// GetName returns name of provider
|
||||
func (b *Base) GetName() string {
|
||||
return b.Name
|
||||
@@ -32,8 +37,3 @@ type Settings struct {
|
||||
APIKeyLvl int `json:"apiKeyLvl"`
|
||||
PrimaryProvider bool `json:"primaryProvider"`
|
||||
}
|
||||
|
||||
// Base enforces standard variables across the provider packages
|
||||
type Base struct {
|
||||
Settings `json:"settings"`
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ import (
|
||||
"github.com/thrasher-corp/gocryptotrader/currency/forexprovider/openexchangerates"
|
||||
)
|
||||
|
||||
// ForexProviders is a foreign exchange handler type
|
||||
type ForexProviders struct {
|
||||
base.FXHandler
|
||||
}
|
||||
|
||||
// GetSupportedForexProviders returns a list of supported forex providers
|
||||
func GetSupportedForexProviders() []string {
|
||||
return []string{
|
||||
@@ -145,8 +150,3 @@ func StartFXService(fxProviders []base.Settings) (*ForexProviders, error) {
|
||||
|
||||
return handler, nil
|
||||
}
|
||||
|
||||
// ForexProviders is a foreign exchange handler type
|
||||
type ForexProviders struct {
|
||||
base.FXHandler
|
||||
}
|
||||
|
||||
@@ -445,6 +445,7 @@ func (b *Bittrex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
// nolint: gocritic
|
||||
depositData := append(closedDepositData, openDepositData...)
|
||||
|
||||
for x := range depositData {
|
||||
@@ -468,6 +469,7 @@ func (b *Bittrex) GetFundingHistory(ctx context.Context) ([]exchange.FundHistory
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
// nolint: gocritic
|
||||
withdrawalData := append(closedWithdrawalData, openWithdrawalData...)
|
||||
|
||||
for x := range withdrawalData {
|
||||
|
||||
@@ -652,6 +652,7 @@ func BenchmarkReverse(b *testing.B) {
|
||||
func BenchmarkSortAsksDecending(b *testing.B) {
|
||||
s := deploySliceOrdered()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortAsks()
|
||||
}
|
||||
@@ -662,6 +663,7 @@ func BenchmarkSortBidsAscending(b *testing.B) {
|
||||
s := deploySliceOrdered()
|
||||
s.Reverse()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortBids()
|
||||
}
|
||||
@@ -671,6 +673,7 @@ func BenchmarkSortBidsAscending(b *testing.B) {
|
||||
func BenchmarkSortAsksStandard(b *testing.B) {
|
||||
s := deployUnorderedSlice()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortAsks()
|
||||
}
|
||||
@@ -680,6 +683,7 @@ func BenchmarkSortAsksStandard(b *testing.B) {
|
||||
func BenchmarkSortBidsStandard(b *testing.B) {
|
||||
s := deployUnorderedSlice()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortBids()
|
||||
}
|
||||
@@ -689,6 +693,7 @@ func BenchmarkSortBidsStandard(b *testing.B) {
|
||||
func BenchmarkSortAsksAscending(b *testing.B) {
|
||||
s := deploySliceOrdered()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortAsks()
|
||||
}
|
||||
@@ -699,6 +704,7 @@ func BenchmarkSortBidsDescending(b *testing.B) {
|
||||
s := deploySliceOrdered()
|
||||
s.Reverse()
|
||||
for i := 0; i < b.N; i++ {
|
||||
// nolint: gocritic
|
||||
ts := append(s[:0:0], s...)
|
||||
ts.SortBids()
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func TestUnsafe(t *testing.T) {
|
||||
|
||||
ob2 := &externalBook{}
|
||||
ob.Lock()
|
||||
ob.Unlock() // nolint:staticcheck // Not needed in test
|
||||
ob.Unlock() // nolint:staticcheck, gocritic // Not needed in test
|
||||
ob.LockWith(ob2)
|
||||
ob.UnlockWith(ob2)
|
||||
}
|
||||
|
||||
@@ -794,6 +794,7 @@ func TestUpdateByIDAndAction(t *testing.T) {
|
||||
holder := orderbookHolder{}
|
||||
|
||||
asks := deploySliceOrdered(100)
|
||||
// nolint: gocritic
|
||||
bids := append(asks[:0:0], asks...)
|
||||
bids.Reverse()
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ func (s *Service) update(p *Price) error {
|
||||
}
|
||||
|
||||
t.Price = *p
|
||||
// nolint: gocritic
|
||||
ids := append(t.Assoc, t.Main)
|
||||
s.Unlock()
|
||||
return s.mux.Publish(ids, p)
|
||||
|
||||
@@ -100,6 +100,7 @@ func (p *Processor) Run(wg *sync.WaitGroup) {
|
||||
for {
|
||||
<-ticker.C
|
||||
p.mutex.Lock()
|
||||
// nolint: gocritic
|
||||
bufferCopy := append(p.buffer[:0:0], p.buffer...)
|
||||
p.buffer = nil
|
||||
p.mutex.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user