gocritic: linter silence (#796)

This commit is contained in:
Luis Rascão
2021-10-07 04:37:55 +01:00
committed by GitHub
parent 4f0d5d175c
commit 4caa1125bc
9 changed files with 23 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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()
}

View File

@@ -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)
}

View File

@@ -794,6 +794,7 @@ func TestUpdateByIDAndAction(t *testing.T) {
holder := orderbookHolder{}
asks := deploySliceOrdered(100)
// nolint: gocritic
bids := append(asks[:0:0], asks...)
bids.Reverse()

View File

@@ -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)

View File

@@ -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()