mirror of
https://github.com/kopia/kopia.git
synced 2026-01-24 14:28:06 -05:00
cli: fixed linter warning
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user