From cf595cd5eac0f5d9bc8643b7519f498a4a744dd3 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Tue, 21 Sep 2021 19:56:05 +0200 Subject: [PATCH] Make golinter happy --- breach_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/breach_test.go b/breach_test.go index ffb1cd5..f24b5b1 100644 --- a/breach_test.go +++ b/breach_test.go @@ -15,7 +15,7 @@ func TestBreaches(t *testing.T) { if err != nil { t.Error(err) } - if len(breachList) <= 0 { + if breachList != nil && len(breachList) <= 0 { t.Error("breaches list returned 0 results") } } @@ -43,6 +43,12 @@ func TestBreachesWithDomain(t *testing.T) { if err != nil { t.Error(err) } + + if breachList == nil && tc.isBreached { + t.Errorf("domain %s is expected to be breached, but returned 0 results.", + tc.domain) + } + breachLen := len(breachList) if tc.isBreached && breachLen <= 0 { t.Errorf("domain %s is expected to be breached, but returned 0 results.",