From 1b51d6717fe49bf1c240fee782311112f52f1ceb Mon Sep 17 00:00:00 2001 From: Omar Kohl Date: Mon, 7 Jan 2019 10:35:29 +0100 Subject: [PATCH] Remove unused 'autoCreate' parameter from getIssuer() function The parameter was not being used (i.e. even if autoCreate == false the CA would be created). --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index dd35d8b..7c311f8 100644 --- a/main.go +++ b/main.go @@ -34,7 +34,7 @@ type issuer struct { cert *x509.Certificate } -func getIssuer(keyFile, certFile string, autoCreate bool) (*issuer, error) { +func getIssuer(keyFile, certFile string) (*issuer, error) { keyContents, keyErr := ioutil.ReadFile(keyFile) certContents, certErr := ioutil.ReadFile(certFile) if os.IsNotExist(keyErr) && os.IsNotExist(certErr) { @@ -42,7 +42,7 @@ func getIssuer(keyFile, certFile string, autoCreate bool) (*issuer, error) { if err != nil { return nil, err } - return getIssuer(keyFile, certFile, false) + return getIssuer(keyFile, certFile) } else if keyErr != nil { return nil, fmt.Errorf("%s (but %s exists)", keyErr, certFile) } else if certErr != nil { @@ -306,7 +306,7 @@ will not overwrite existing keys or certificates. os.Exit(1) } } - issuer, err := getIssuer(*caKey, *caCert, true) + issuer, err := getIssuer(*caKey, *caCert) if err != nil { return err }