don't display message unless logger has been specified (#1165)

This commit is contained in:
Egon Elbre 2019-01-29 14:12:24 +02:00 committed by GitHub
parent e1a8bbdcb6
commit 54eb1b099c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,9 @@ func NewCA(ctx context.Context, opts NewCAOptions) (_ *FullCertificateAuthority,
opts.Concurrency = 1
}
fmt.Printf("Generating key with a minimum a difficulty of %d...\n", opts.Difficulty)
if opts.Logger != nil {
fmt.Fprintf(opts.Logger, "Generating key with a minimum a difficulty of %d...\n", opts.Difficulty)
}
updateStatus := func() {
if opts.Logger != nil {
count := atomic.LoadUint32(i)