Commit 263e7dd2 authored by Heiko Reese's avatar Heiko Reese
Browse files

lint

parent 374f97e1
......@@ -66,7 +66,7 @@ var getpdfCmd = &cobra.Command{
}
// create http client
httpclient, err := dfnpki.GetHTTPClient()
httpclient, err := dfnpki.GetPublicHTTPClient()
if err != nil {
log.Fatal(err)
}
......@@ -89,7 +89,7 @@ var getpdfCmd = &cobra.Command{
if err != nil {
log.Fatalf("Unable to retrieve PDF: %s", err)
}
ioutil.WriteFile(filename, pdf, 0644)
err = ioutil.WriteFile(filename, pdf, 0644)
if err != nil {
log.Fatalf("Unable to write PDF file »%s«: %s", filename, err)
}
......
......@@ -58,9 +58,9 @@ var requestCmd = &cobra.Command{
basefilename string
outputdir string
)
viper.BindPFlags(cmd.PersistentFlags())
_ = viper.BindPFlags(cmd.PersistentFlags())
// write config values into cmdArguments
viper.Unmarshal(&cmdArguments)
_ = viper.Unmarshal(&cmdArguments)
// check ca name
if !viper.IsSet("ca") {
......@@ -121,7 +121,7 @@ var requestCmd = &cobra.Command{
log.Printf("Output directory is »%s«", outputdir)
// create http client
httpclient, err := dfnpki.GetHTTPClient()
httpclient, err := dfnpki.GetPublicHTTPClient()
if err != nil {
log.Fatal(err)
}
......@@ -336,7 +336,7 @@ var requestCmd = &cobra.Command{
}
filename = filepath.Join(outputdir, basefilename+".request.pdf")
if viper.GetBool("dry-run") == false {
ioutil.WriteFile(filename, pdf, 0644)
err = ioutil.WriteFile(filename, pdf, 0644)
if err != nil {
log.Fatalf("Unable to write PDF file »%s«: %s", filename, err)
}
......@@ -371,7 +371,7 @@ func init() {
requestCmd.PersistentFlags().BoolVar(&cmdArguments.Publish, "publish", true, "Publish certificate")
requestCmd.PersistentFlags().StringVar(&cmdArguments.PIN, "pin", "", "PIN for revocation and retrieval of unpublished certificates")
requestCmd.PersistentFlags().StringVarP(&cmdArguments.Keyfile, "keyfile", "k", "", "Read key from filename if set; autogenerated otherwise")
requestCmd.MarkFlagFilename("keyfile", "")
_ = requestCmd.MarkFlagFilename("keyfile", "")
requestCmd.PersistentFlags().StringVarP(&cmdArguments.Keypass, "keypass", "p", "", "Password if secret key is encrypted")
requestCmd.PersistentFlags().IntVar(&cmdArguments.Keysize, "keysize", 4096, "Size of secret key in bits (only used if --keyfile is not set; minimum size 2048 bits)")
requestCmd.PersistentFlags().StringVarP(&cmdArguments.Outdir, "outdir", "o", "{{-.CommonNameSanitized}}_{{-.TimeStamp}}", "Directory for all output files")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment