Rearrange cert add after err check for idiomatic
This commit is contained in:
parent
1082bffddd
commit
9b89439ec2
|
@ -126,12 +126,11 @@ func readCert(file string) (cert *x509.Certificate, key interface{}, err error)
|
|||
|
||||
if key == nil {
|
||||
key, cert, err = pkcs12.Decode(d, "")
|
||||
certs = append(certs, cert)
|
||||
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf(
|
||||
"Did not find private key in file, tried to read as PKCS#12 and failed: %v", err)
|
||||
}
|
||||
certs = append(certs, cert)
|
||||
}
|
||||
|
||||
if key == nil {
|
||||
|
|
Loading…
Reference in New Issue