mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +00:00
gocritic: linter silence (#796)
This commit is contained in:
@@ -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