Explorar el Código

use check utl

Fabrizio (Misto) Milo hace 12 años
padre
commit
0aebf3757d
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3 5
      etcd.go

+ 3 - 5
etcd.go

@@ -340,15 +340,13 @@ func newCertPool(CAFile string) (tls.ClientAuthType, *x509.CertPool) {
 	if CAFile == "" {
 		return tls.NoClientCert, nil
 	}
-	pemByte, _ := ioutil.ReadFile(CAFile)
+	pemByte, err := ioutil.ReadFile(CAFile)
+	check(err)
 
 	block, pemByte := pem.Decode(pemByte)
 
 	cert, err := x509.ParseCertificate(block.Bytes)
-
-	if err != nil {
-		fatal(err)
-	}
+	check(err)
 
 	certPool := x509.NewCertPool()