diff options
author | Gibheer <gibheer@gmail.com> | 2015-01-15 06:55:13 +0100 |
---|---|---|
committer | Gibheer <gibheer@gmail.com> | 2015-01-15 06:55:13 +0100 |
commit | eda483d0d115dfbd96413cf952ab1c58e6665ff5 (patch) | |
tree | 279f1ed5b38129521fc0b4991f9090fc1ab8fa10 /public_key.go | |
parent | 7097d3b058faceabcfd33c7a024b779169d2a307 (diff) |
fix typo and missing file close
Diffstat (limited to 'public_key.go')
-rw-r--r-- | public_key.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/public_key.go b/public_key.go index fc1ea23..815ba7b 100644 --- a/public_key.go +++ b/public_key.go @@ -25,6 +25,8 @@ func create_public_key() { if err != nil { crash_with_help(2, fmt.Sprintf("Error when creating file %s: %s", flags.Output, err)) } + defer flags.output_stream.Close() + priv_key := load_private_key(flags.PrivateKeyPath) marshal, err := x509.MarshalPKIXPublicKey(priv_key.Public()) if err != nil { @@ -39,7 +41,7 @@ func parse_public_key_flags() PublicKeyFlags { flags := PublicKeyFlags{} fs := flag.NewFlagSet("create-public", flag.ExitOnError) fs.StringVar(&flags.PrivateKeyPath, "private-key", "", "path to the private key file") - fs.StringVar(&flags.Output, "output", "STDOUT", "path where the generated csr should be stored") + fs.StringVar(&flags.Output, "output", "STDOUT", "path where the generated public key should be stored") fs.Parse(os.Args[2:]) return flags |