mirror of
https://github.com/golang/go
synced 2024-11-17 20:44:47 -07:00
crypto/x509: remove redundant check for nil in tests
Comparing err variable to be not nil is redundant in this case. The code above ensures that it is always not nil. Updates #30208
This commit is contained in:
parent
ffd096db2b
commit
372e0fd48f
@ -2220,10 +2220,8 @@ func TestBadNamesInSANs(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
if str := err.Error(); !strings.Contains(str, "cannot parse ") {
|
if str := err.Error(); !strings.Contains(str, "cannot parse ") {
|
||||||
t.Errorf("bad name %q triggered unrecognised error: %s", badName, str)
|
t.Errorf("bad name %q triggered unrecognised error: %s", badName, str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user