Commit 576a3c61 authored by Marat Khabibullin's avatar Marat Khabibullin Committed by Daniel Martí

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

Change-Id: I0a41601273de36a05d22270a743c0bdedeb1d0bf
GitHub-Last-Rev: 372e0fd48f90f33e266fbcdf2ccf87b9f1311c4f
GitHub-Pull-Request: golang/go#30213
Reviewed-on: https://go-review.googlesource.com/c/162439Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6d781dec
...@@ -2220,10 +2220,8 @@ func TestBadNamesInSANs(t *testing.T) { ...@@ -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)
} }
} }
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment