Rearrange cert add after err check for idiomatic

This commit is contained in:
Boran Car 2020-10-20 22:20:57 +02:00
parent 1082bffddd
commit 9b89439ec2
1 changed files with 1 additions and 2 deletions

View File

@ -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 {