1
0
mirror of https://github.com/golang/go synced 2024-11-17 18:24:45 -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:
Marat Khabibullin 2019-02-13 17:40:18 +03:00
parent ffd096db2b
commit 372e0fd48f

View File

@ -2220,10 +2220,8 @@ func TestBadNamesInSANs(t *testing.T) {
continue
}
if err != nil {
if str := err.Error(); !strings.Contains(str, "cannot parse ") {
t.Errorf("bad name %q triggered unrecognised error: %s", badName, str)
}
}
}
}