1
0
mirror of https://github.com/golang/go synced 2024-11-25 00:07:56 -07:00

crypto/tls: fix compile error

Fixes #1555.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4284047
This commit is contained in:
Dave Cheney 2011-03-12 19:35:41 -08:00 committed by Brad Fitzpatrick
parent 3479bb6c12
commit 43ae7da190

View File

@ -25,7 +25,7 @@ func main() {
priv, err := rsa.GenerateKey(rand.Reader, 1024)
if err != nil {
log.Exitf("failed to generate private key: %s", err)
log.Fatalf("failed to generate private key: %s", err)
return
}
@ -46,13 +46,13 @@ func main() {
derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv)
if err != nil {
log.Exitf("Failed to create certificate: %s", err)
log.Fatalf("Failed to create certificate: %s", err)
return
}
certOut, err := os.Open("cert.pem", os.O_WRONLY|os.O_CREAT, 0644)
if err != nil {
log.Exitf("failed to open cert.pem for writing: %s", err)
log.Fatalf("failed to open cert.pem for writing: %s", err)
return
}
pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})