Skip to content

Commit 9dd2a8d

Browse files
committed
Address fun lint surprise
See golangci/golangci-lint#741 (comment)
1 parent 8a8e173 commit 9dd2a8d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

backtester/funding/funding_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,10 @@ func TestGenerateReport(t *testing.T) {
757757
t.Parallel()
758758
f := FundManager{}
759759
report := f.GenerateReport()
760-
if report == nil {
760+
if report == nil { //lint:ignore SA5011 Ignore the nil warnings
761761
t.Fatal("shouldn't be nil")
762762
}
763-
if len(report.Items) > 0 {
763+
if len(report.Items) > 0 { //lint:ignore SA5011 Ignore the nil warnings
764764
t.Error("expected 0")
765765
}
766766
item := &Item{

engine/event_manager_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ func TestSetupEventManager(t *testing.T) {
2727
if !errors.Is(err, nil) {
2828
t.Fatalf("error '%v', expected '%v'", err, nil)
2929
}
30-
if m == nil {
30+
if m == nil { //lint:ignore SA5011 Ignore the nil warnings
3131
t.Fatal("expected manager")
3232
}
33-
if m.sleepDelay == 0 {
33+
if m.sleepDelay == 0 { //lint:ignore SA5011 Ignore the nil warnings
3434
t.Error("expected default set")
3535
}
3636
}

engine/exchange_manager_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
func TestSetupExchangeManager(t *testing.T) {
1515
t.Parallel()
1616
m := SetupExchangeManager()
17-
if m == nil {
17+
if m == nil { //lint:ignore SA5011 Ignore the nil warnings
1818
t.Fatalf("unexpected response")
1919
}
20-
if m.exchanges == nil {
20+
if m.exchanges == nil { //lint:ignore SA5011 Ignore the nil warnings
2121
t.Error("unexpected response")
2222
}
2323
}

engine/order_manager_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ func TestGetByInternalOrderID(t *testing.T) {
268268
if err != nil {
269269
t.Error(err)
270270
}
271-
if o == nil {
271+
if o == nil { //lint:ignore SA5011 Ignore the nil warnings
272272
t.Fatal("Expected a matching order")
273273
}
274-
if o.ID != "TestGetByInternalOrderID" {
274+
if o.ID != "TestGetByInternalOrderID" { //lint:ignore SA5011 Ignore the nil warnings
275275
t.Error("Expected to retrieve order")
276276
}
277277

@@ -426,10 +426,10 @@ func TestStore_modifyOrder(t *testing.T) {
426426
}
427427

428428
det, err := m.orderStore.getByExchangeAndID(testExchange, "another_fake_order_id")
429-
if det == nil || err != nil {
429+
if det == nil || err != nil { //lint:ignore SA5011 Ignore the nil warnings
430430
t.Fatal("Failed to fetch order details")
431431
}
432-
if det.ID != "another_fake_order_id" || det.Price != 16 || det.Amount != 256 {
432+
if det.ID != "another_fake_order_id" || det.Price != 16 || det.Amount != 256 { //lint:ignore SA5011 Ignore the nil warnings
433433
t.Errorf(
434434
"have (%s,%f,%f), want (%s,%f,%f)",
435435
det.ID, det.Price, det.Amount,

0 commit comments

Comments
 (0)