From 18532f736bc1ba39ab99eaecd81ce5ea83c9af4a Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Sat, 29 Dec 2018 15:29:21 -0800 Subject: [PATCH] cli: fixed linter warning --- cli/command_block_crypto_benchmark.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/command_block_crypto_benchmark.go b/cli/command_block_crypto_benchmark.go index c4a2554ff..1ccadb55c 100644 --- a/cli/command_block_crypto_benchmark.go +++ b/cli/command_block_crypto_benchmark.go @@ -44,12 +44,15 @@ func runBlockCryptoBenchmarkAction(ctx *kingpin.ParseContext) error { continue } - printStderr("Benchmarking hash '%v' and encryption '%v'...\n", ha, ea) + log.Infof("Benchmarking hash '%v' and encryption '%v'... (%v x %v bytes)", ha, ea, *blockCryptoBenchmarkRepeat, len(data)) t0 := time.Now() hashCount := *blockCryptoBenchmarkRepeat for i := 0; i < hashCount; i++ { blockID := h(data) - e.Encrypt(data, blockID) + if _, encerr := e.Encrypt(data, blockID); encerr != nil { + log.Warningf("encryption failed: %v", encerr) + break + } } hashTime := time.Since(t0) bytesPerSecond := float64(len(data)) * float64(hashCount) / hashTime.Seconds()