Make golinter happy

This commit is contained in:
Winni Neessen 2021-09-21 19:56:05 +02:00
parent a50a8603eb
commit cf595cd5ea

View file

@ -15,7 +15,7 @@ func TestBreaches(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
if len(breachList) <= 0 { if breachList != nil && len(breachList) <= 0 {
t.Error("breaches list returned 0 results") t.Error("breaches list returned 0 results")
} }
} }
@ -43,6 +43,12 @@ func TestBreachesWithDomain(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) 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) breachLen := len(breachList)
if tc.isBreached && breachLen <= 0 { if tc.isBreached && breachLen <= 0 {
t.Errorf("domain %s is expected to be breached, but returned 0 results.", t.Errorf("domain %s is expected to be breached, but returned 0 results.",